| 1 | <?php namespace Stevenmaguire\OAuth2\Client\Provider; |
||
| 5 | class UberResourceOwner implements ResourceOwnerInterface |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Raw response |
||
| 9 | * |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | protected $response; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Creates new resource owner. |
||
| 16 | * |
||
| 17 | * @param array $response |
||
| 18 | */ |
||
| 19 | 3 | public function __construct(array $response = array()) |
|
| 23 | |||
| 24 | /** |
||
| 25 | * Get user email |
||
| 26 | * |
||
| 27 | * @return string|null |
||
| 28 | */ |
||
| 29 | 3 | public function getEmail() |
|
| 30 | { |
||
| 31 | 3 | return $this->response['email'] ?: null; |
|
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Get user firstname |
||
| 36 | * |
||
| 37 | * @return string|null |
||
| 38 | */ |
||
| 39 | 3 | public function getFirstname() |
|
| 40 | { |
||
| 41 | 3 | return $this->response['first_name'] ?: null; |
|
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Get user imageurl |
||
| 46 | * |
||
| 47 | * @return string|null |
||
| 48 | */ |
||
| 49 | 3 | public function getImageurl() |
|
| 50 | { |
||
| 51 | 3 | return $this->response['picture'] ?: null; |
|
| 52 | } |
||
| 53 | |||
| 54 | /** |
||
| 55 | * Get user lastname |
||
| 56 | * |
||
| 57 | * @return string|null |
||
| 58 | */ |
||
| 59 | 3 | public function getLastname() |
|
| 60 | { |
||
| 61 | 3 | return $this->response['last_name'] ?: null; |
|
| 62 | } |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Get user userId |
||
| 66 | * |
||
| 67 | * @return string|null |
||
| 68 | */ |
||
| 69 | 3 | public function getId() |
|
| 70 | { |
||
| 71 | 3 | return $this->response['uuid'] ?: null; |
|
| 72 | } |
||
| 73 | |||
| 74 | /** |
||
| 75 | * Return all of the owner details available as an array. |
||
| 76 | * |
||
| 77 | * @return array |
||
| 78 | */ |
||
| 79 | 3 | public function toArray() |
|
| 83 | } |
||
| 84 |