From 9236cd4dd76f764342408d7e051fab021ae12291 Mon Sep 17 00:00:00 2001 From: Kong Jin Jie Date: Tue, 3 Jul 2018 12:14:43 +0800 Subject: [PATCH] Always return NULL for attributes property_exists($this, 'key') will never be true. Using $key instead. --- src/User.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/User.php b/src/User.php index 2b380fc..4d8a47d 100644 --- a/src/User.php +++ b/src/User.php @@ -44,7 +44,7 @@ class User public function __construct($attributes = []) { foreach ($attributes as $key => $value) { - if (property_exists($this, 'key')) { + if (property_exists($this, $key)) { $this->$key = $value; } } @@ -155,4 +155,4 @@ public function getResponseData() return $data; } -} \ No newline at end of file +}