Total Complexity | 3 |
Total Lines | 33 |
Duplicated Lines | 0 % |
Coverage | 42.86% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class EmailValidation extends Model |
||
12 | { |
||
13 | /** @var boolean */ |
||
14 | protected $ok; |
||
15 | |||
16 | /** |
||
17 | * parse |
||
18 | * |
||
19 | * @param array $data |
||
20 | * @author Tiago Araujo <[email protected]> |
||
21 | */ |
||
22 | 1 | public function parse(array $data) |
|
23 | { |
||
24 | 1 | $this->ok = (int)$data['ok']; |
|
|
|||
25 | 1 | } |
|
26 | |||
27 | /** |
||
28 | * toArray |
||
29 | * |
||
30 | * @return array |
||
31 | * @author Tiago Araujo <[email protected]> |
||
32 | */ |
||
33 | public function toArray(): array |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @return bool |
||
40 | */ |
||
41 | public function isOk(): bool |
||
46 | } |
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.