| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 29 | public function __construct($dayOfWeek) |
||
| 30 | { |
||
| 31 | if (false === filter_var($dayOfWeek, FILTER_VALIDATE_INT)) { |
||
| 32 | throw new \InvalidArgumentException('Integer required'); |
||
| 33 | } |
||
| 34 | |||
| 35 | if ($dayOfWeek <= 0) { |
||
| 36 | throw new \OutOfBoundsException('Day of week less than 1'); |
||
| 37 | } |
||
| 38 | |||
| 39 | if ($dayOfWeek > 7) { |
||
| 40 | throw new \OutOfBoundsException('Day of week greater than 7'); |
||
| 41 | } |
||
| 42 | |||
| 43 | $this->weekday = (int)$dayOfWeek; |
||
|
|
|||
| 44 | } |
||
| 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..