Total Complexity | 6 |
Total Lines | 79 |
Duplicated Lines | 0 % |
Coverage | 31.58% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Resource extends Model |
||
12 | { |
||
13 | /** @var int */ |
||
14 | protected $id; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $url; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $lastUpdatedAt; |
||
21 | |||
22 | /** @var \NStack\Models\Language */ |
||
23 | protected $language; |
||
24 | |||
25 | /** |
||
26 | * parse |
||
27 | * |
||
28 | * @param array $data |
||
29 | * @throws \NStack\Exceptions\FailedToParseException |
||
30 | * @author Casper Rasmussen <[email protected]> |
||
31 | */ |
||
32 | 1 | public function parse(array $data) |
|
33 | { |
||
34 | 1 | $this->id = (int)$data['id']; |
|
35 | 1 | $this->url = (string)$data['url']; |
|
36 | 1 | $this->lastUpdatedAt = (string)$data['last_updated_at']; |
|
37 | 1 | $this->language = new Language($data['language']); |
|
38 | 1 | } |
|
39 | |||
40 | /** |
||
41 | * toArray |
||
42 | * |
||
43 | * @return array |
||
44 | * @author Casper Rasmussen <[email protected]> |
||
45 | */ |
||
46 | public function toArray(): array |
||
53 | ]; |
||
54 | } |
||
55 | |||
56 | /** |
||
57 | * @return int |
||
58 | * @author Casper Rasmussen <[email protected]> |
||
59 | */ |
||
60 | public function getId(): int |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | * @author Casper Rasmussen <[email protected]> |
||
68 | */ |
||
69 | public function getUrl(): string |
||
72 | } |
||
73 | |||
74 | /** |
||
75 | * @return string |
||
76 | * @author Casper Rasmussen <[email protected]> |
||
77 | */ |
||
78 | public function getLastUpdatedAt(): string |
||
81 | } |
||
82 | |||
83 | /** |
||
84 | * @return \NStack\Models\Language |
||
85 | * @author Casper Rasmussen <[email protected]> |
||
86 | */ |
||
87 | public function getLanguage(): \NStack\Models\Language |
||
90 | } |
||
91 | } |