We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 5 | public function validate($input) |
|
| 27 | { |
||
| 28 | 5 | if (is_string($input)) { |
|
| 29 | 2 | $date = DateTimeImmutable::createFromFormat($this->format, $input); |
|
| 30 | 3 | } elseif ($input instanceof DateTimeInterface) { |
|
| 31 | 2 | $date = $input; |
|
| 32 | } else { |
||
| 33 | 1 | return false; |
|
| 34 | } |
||
| 35 | |||
| 36 | // Dates that aren't leap will aways be rounded |
||
| 37 | 4 | return $date->format('m-d') == '02-29'; |
|
| 38 | } |
||
| 39 | } |
||
| 40 |