From 5596bc7350e9f42d88d1fca14f9c4e0c28b2fc78 Mon Sep 17 00:00:00 2001 From: trogwar Date: Fri, 1 Jul 2016 17:43:00 +0300 Subject: [PATCH] =?UTF-8?q?Sometimes,=20VKontakte=20sets=20user=20IDentifi?= =?UTF-8?q?cator=20as=20`uid`=20or=20`id`=20=E2=80=93=20use=20both=20of=20?= =?UTF-8?q?them=20in=20ID=20getter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/User.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/User.php b/src/User.php index f6f94af..a0ed04e 100644 --- a/src/User.php +++ b/src/User.php @@ -39,7 +39,7 @@ class User implements ResourceOwnerInterface */ public function getId() { - return (int)$this->response['uid']; + return (int)($this->getField('uid') ?: $this->getField('id')); } // ========== helpers ==========