From 6854cb3f4d8219cf1829e32122eb2502a916eae9 Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Sat, 1 Feb 2020 09:05:48 +0100 Subject: initial checkin --- vendor/league/oauth2-client/src/Entity/User.php | 117 ++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 vendor/league/oauth2-client/src/Entity/User.php (limited to 'vendor/league/oauth2-client/src/Entity/User.php') diff --git a/vendor/league/oauth2-client/src/Entity/User.php b/vendor/league/oauth2-client/src/Entity/User.php new file mode 100644 index 0000000..756e09a --- /dev/null +++ b/vendor/league/oauth2-client/src/Entity/User.php @@ -0,0 +1,117 @@ +{$name}; + } + + public function __set($property, $value) + { + if (!property_exists($this, $property)) { + throw new \OutOfRangeException(sprintf( + '%s does not contain a property by the name of "%s"', + __CLASS__, + $property + )); + } + + $this->$property = $value; + + return $this; + } + + public function __isset($name) + { + return (property_exists($this, $name)); + } + + public function getArrayCopy() + { + return [ + 'uid' => $this->uid, + 'nickname' => $this->nickname, + 'name' => $this->name, + 'firstName' => $this->firstName, + 'lastName' => $this->lastName, + 'email' => $this->email, + 'location' => $this->location, + 'description' => $this->description, + 'imageUrl' => $this->imageUrl, + 'urls' => $this->urls, + 'gender' => $this->gender, + 'locale' => $this->locale, + ]; + } + + public function exchangeArray(array $data) + { + foreach ($data as $key => $value) { + $key = strtolower($key); + switch ($key) { + case 'uid': + $this->uid = $value; + break; + case 'nickname': + $this->nickname = $value; + break; + case 'name': + $this->name = $value; + break; + case 'firstname': + $this->firstName = $value; + break; + case 'lastname': + $this->lastName = $value; + break; + case 'email': + $this->email = $value; + break; + case 'location': + $this->location = $value; + break; + case 'description': + $this->description = $value; + break; + case 'imageurl': + $this->imageUrl = $value; + break; + case 'urls': + $this->urls = $value; + break; + case 'gender': + $this->gender = $value; + break; + case 'locale': + $this->locale = $value; + break; + } + } + + return $this; + } +} -- cgit v1.2.3-70-g09d2