Total Complexity | 6 |
Total Lines | 78 |
Duplicated Lines | 0 % |
Coverage | 31.58% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class Continent extends Model |
||
12 | { |
||
13 | /** @var int */ |
||
14 | protected $id; |
||
15 | |||
16 | /** @var string */ |
||
17 | protected $name; |
||
18 | |||
19 | /** @var string */ |
||
20 | protected $code; |
||
21 | |||
22 | /** @var string */ |
||
23 | protected $imageUrl; |
||
24 | |||
25 | /** |
||
26 | * parse |
||
27 | * |
||
28 | * @param array $data |
||
29 | * @author Casper Rasmussen <[email protected]> |
||
30 | */ |
||
31 | 2 | public function parse(array $data) |
|
32 | { |
||
33 | 2 | $this->id = (int)$data['id']; |
|
34 | 2 | $this->name = (string)$data['name']; |
|
35 | 2 | $this->code = (string)$data['code']; |
|
36 | 2 | $this->imageUrl = (string)$data['image_url']; |
|
37 | 2 | } |
|
38 | |||
39 | /** |
||
40 | * toArray |
||
41 | * |
||
42 | * @return array |
||
43 | * @author Casper Rasmussen <[email protected]> |
||
44 | */ |
||
45 | public function toArray(): array |
||
52 | ]; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * @return int |
||
57 | * @author Casper Rasmussen <[email protected]> |
||
58 | */ |
||
59 | public function getId(): int |
||
60 | { |
||
61 | return $this->id; |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return string |
||
66 | * @author Casper Rasmussen <[email protected]> |
||
67 | */ |
||
68 | public function getName(): string |
||
71 | } |
||
72 | |||
73 | /** |
||
74 | * @return string |
||
75 | * @author Casper Rasmussen <[email protected]> |
||
76 | */ |
||
77 | public function getCode(): string |
||
78 | { |
||
79 | return $this->code; |
||
80 | } |
||
81 | |||
82 | /** |
||
83 | * @return string |
||
84 | * @author Casper Rasmussen <[email protected]> |
||
85 | */ |
||
86 | public function getImageUrl(): string |
||
89 | } |
||
90 | } |