| Total Complexity | 6 |
| Total Lines | 69 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class JiraResourceOwner implements ResourceOwnerInterface |
||
| 9 | { |
||
| 10 | use ArrayAccessorTrait; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * Raw response |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $response; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Creates new resource owner. |
||
| 21 | * |
||
| 22 | * @param array $response |
||
| 23 | */ |
||
| 24 | public function __construct(array $response = []) |
||
| 25 | { |
||
| 26 | $this->response = $response; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Get resource owner email |
||
| 31 | * |
||
| 32 | * @return string|null |
||
| 33 | */ |
||
| 34 | public function getEmail() |
||
| 35 | { |
||
| 36 | return $this->getValueByKey($this->response, 'emailAddress'); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get resource owner id |
||
| 41 | * |
||
| 42 | * @return string|null |
||
| 43 | */ |
||
| 44 | public function getId() |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Get resource owner name |
||
| 51 | * |
||
| 52 | * @return string|null |
||
| 53 | */ |
||
| 54 | public function getName() |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Get resource owner nickname |
||
| 61 | * |
||
| 62 | * @return string|null |
||
| 63 | */ |
||
| 64 | public function getNickname() |
||
| 65 | { |
||
| 66 | return $this->getValueByKey($this->response, 'name'); |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Return all of the owner details available as an array. |
||
| 71 | * |
||
| 72 | * @return array |
||
| 73 | */ |
||
| 74 | public function toArray() |
||
| 77 | } |
||
| 78 | } |
||
| 79 |