| Total Complexity | 8 |
| Total Lines | 66 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class CloudConvertResourceOwner implements ResourceOwnerInterface |
||
| 10 | { |
||
| 11 | private int $id; |
||
| 12 | private string $username; |
||
| 13 | private string $email; |
||
| 14 | private int $credits; |
||
| 15 | private array $links; |
||
| 16 | private \DateTime $createdAt; |
||
| 17 | |||
| 18 | public function __construct(array $response) |
||
| 19 | { |
||
| 20 | $data = $response['data']; |
||
| 21 | |||
| 22 | $this->id = $data['id']; |
||
| 23 | $this->username = $data['username']; |
||
| 24 | $this->email = $data['email']; |
||
| 25 | $this->credits = $data['credits']; |
||
| 26 | $this->links = $data['links']; |
||
| 27 | $this->createdAt = new \DateTime($data['created_at']); |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getId(): int |
||
| 31 | { |
||
| 32 | return $this->id; |
||
| 33 | } |
||
| 34 | |||
| 35 | public function getUsername(): string |
||
| 36 | { |
||
| 37 | return $this->username; |
||
| 38 | } |
||
| 39 | |||
| 40 | public function getEmail(): string |
||
| 41 | { |
||
| 42 | return $this->email; |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getCredits(): int |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @return string[] |
||
| 52 | */ |
||
| 53 | public function getLinks(): array |
||
| 54 | { |
||
| 55 | return $this->links; |
||
| 56 | } |
||
| 57 | |||
| 58 | public function getCreatedAt(): \DateTime |
||
| 61 | } |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @return mixed[] |
||
| 65 | */ |
||
| 66 | public function toArray(): array |
||
| 75 | ]; |
||
| 76 | } |
||
| 77 | } |
||
| 78 |