Total Complexity | 6 |
Total Lines | 73 |
Duplicated Lines | 0 % |
Coverage | 31.58% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class VersionControlUpdate extends Model |
||
12 | { |
||
13 | /** @var String */ |
||
14 | protected $update; |
||
15 | |||
16 | /** @var array */ |
||
17 | protected $updateVersions; |
||
18 | |||
19 | /** @var bool */ |
||
20 | protected $newInVersion; |
||
21 | |||
22 | /** @var array */ |
||
23 | protected $newInVersions; |
||
24 | |||
25 | /** |
||
26 | * parse |
||
27 | * |
||
28 | * @param array $data |
||
29 | */ |
||
30 | 1 | public function parse(array $data) |
|
31 | { |
||
32 | 1 | $this->update = (String)$data['update']; |
|
33 | 1 | $this->updateVersions = (array)$data['update_versions']; |
|
34 | 1 | $this->newInVersion = (string)$data['new_in_version']; |
|
|
|||
35 | 1 | $this->newInVersions = (array)$data['new_in_versions']; |
|
36 | 1 | } |
|
37 | |||
38 | /** |
||
39 | * toArray |
||
40 | * |
||
41 | * @return array |
||
42 | * @author Casper Rasmussen <[email protected]> |
||
43 | */ |
||
44 | public function toArray(): array |
||
45 | { |
||
46 | return [ |
||
47 | 'update' => $this->update, |
||
48 | 'update_versions' => $this->updateVersions, |
||
49 | 'new_in_version' => $this->newInVersion, |
||
50 | 'new_in_versions' => $this->newInVersions, |
||
51 | ]; |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return String |
||
56 | */ |
||
57 | public function getUpdate(): String |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @return array |
||
64 | */ |
||
65 | public function getUpdateVersions(): array |
||
66 | { |
||
67 | return $this->updateVersions; |
||
68 | } |
||
69 | |||
70 | /** |
||
71 | * @return bool |
||
72 | */ |
||
73 | public function isNewInVersion(): bool |
||
76 | } |
||
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | public function getNewInVersions(): array |
||
84 | } |
||
85 | |||
86 | } |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.