Total Complexity | 9 |
Total Lines | 53 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | class SePayResourceOwner implements ResourceOwnerInterface |
||
11 | { |
||
12 | use ArrayAccessorTrait; |
||
13 | |||
14 | protected array $data; |
||
15 | |||
16 | public function __construct(array $response) |
||
17 | { |
||
18 | $this->data = $response['data']; |
||
19 | } |
||
20 | |||
21 | public function getId(): int |
||
22 | { |
||
23 | return $this->getValueByKey($this->data, 'id'); |
||
|
|||
24 | } |
||
25 | |||
26 | public function getEmail(): string |
||
27 | { |
||
28 | return $this->getValueByKey($this->data, 'email'); |
||
29 | } |
||
30 | |||
31 | public function getName(): string |
||
32 | { |
||
33 | return sprintf( |
||
34 | '%s %s', |
||
35 | $this->getFirstName(), |
||
36 | $this->getLastName() |
||
37 | ); |
||
38 | } |
||
39 | |||
40 | public function getFirstName(): string |
||
41 | { |
||
42 | return $this->getValueByKey($this->data, 'first_name'); |
||
43 | } |
||
44 | |||
45 | public function getLastName(): string |
||
48 | } |
||
49 | |||
50 | public function getAvatarUrl(): string |
||
53 | } |
||
54 | |||
55 | public function getPhone(): string |
||
56 | { |
||
57 | return $this->getValueByKey($this->data, 'phone'); |
||
58 | } |
||
59 | |||
60 | public function toArray(): array |
||
63 | } |
||
64 | } |
||
65 |