Conditions | 4 |
Paths | 4 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 4 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
29 | 70 | public function __construct($dayOfWeek) |
|
30 | { |
||
31 | 70 | if (false === filter_var($dayOfWeek, FILTER_VALIDATE_INT)) { |
|
32 | 1 | throw new \InvalidArgumentException('Integer required'); |
|
33 | } |
||
34 | |||
35 | 69 | if ($dayOfWeek <= 0) { |
|
36 | 1 | throw new \OutOfBoundsException('Day of week less than 1'); |
|
37 | } |
||
38 | |||
39 | 68 | if ($dayOfWeek > 7) { |
|
40 | 1 | throw new \OutOfBoundsException('Day of week greater than 7'); |
|
41 | } |
||
42 | |||
43 | 67 | $this->weekday = (int)$dayOfWeek; |
|
|
|||
44 | 67 | } |
|
45 | |||
55 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..