| Total Complexity | 8 |
| Total Lines | 57 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class KeycloakResourceOwner implements ResourceOwnerInterface |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Raw response |
||
| 11 | * |
||
| 12 | * @var array |
||
| 13 | */ |
||
| 14 | protected $response; |
||
| 15 | |||
| 16 | /** |
||
| 17 | * Creates new resource owner. |
||
| 18 | * |
||
| 19 | * @param array $response |
||
| 20 | */ |
||
| 21 | public function __construct(array $response = array()) |
||
| 22 | { |
||
| 23 | $this->response = $response; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Get resource owner id |
||
| 28 | * |
||
| 29 | * @return string|null |
||
| 30 | */ |
||
| 31 | public function getId() |
||
| 32 | { |
||
| 33 | return $this->response['sub'] ?: null; |
||
| 34 | } |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get resource owner email |
||
| 38 | * |
||
| 39 | * @return string|null |
||
| 40 | */ |
||
| 41 | public function getEmail() |
||
| 44 | } |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get resource owner name |
||
| 48 | * |
||
| 49 | * @return string|null |
||
| 50 | */ |
||
| 51 | public function getName() |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Return all of the owner details available as an array. |
||
| 58 | * |
||
| 59 | * @return array |
||
| 60 | */ |
||
| 61 | public function toArray() |
||
| 66 |