| Conditions | 2 |
| Paths | 2 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | public function set($day, $month, $year) |
||
| 39 | { |
||
| 40 | $validator = new DateValidator($day, $month, $year); |
||
| 41 | |||
| 42 | if (!$validator->isValid()) { |
||
| 43 | throw new InvalidDateException(); |
||
| 44 | } |
||
| 45 | |||
| 46 | $this->day = $day; |
||
| 47 | $this->month = $month; |
||
| 48 | $this->year = $year; |
||
| 49 | |||
| 50 | $this->jdn = static::process($day, $month, $year); |
||
|
|
|||
| 51 | |||
| 52 | return $this; |
||
| 53 | } |
||
| 54 | |||
| 65 |
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.