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 |
||
25 | 5 | public function validate($input) |
|
26 | { |
||
27 | 5 | if (is_string($input)) { |
|
28 | 2 | $date = DateTime::createFromFormat($this->format, $input); |
|
29 | 3 | } elseif ($input instanceof DateTime) { |
|
30 | 2 | $date = $input; |
|
31 | } else { |
||
32 | 1 | return false; |
|
33 | } |
||
34 | |||
35 | // Dates that aren't leap will aways be rounded |
||
36 | 4 | return $date->format('m-d') == '02-29'; |
|
37 | } |
||
38 | } |
||
39 |