Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 0 |
1 | <?php |
||
16 | public function isDateValid(string $dateString): bool |
||
17 | { |
||
18 | 1 | if (!$this->isValidDateAgainstRegex($dateString)) { |
|
19 | 1 | return false; |
|
20 | } |
||
21 | |||
22 | 1 | $date = $this->createDateFromString($dateString); |
|
23 | 1 | if (false === $date) { |
|
24 | return false; |
||
25 | } |
||
26 | |||
27 | 1 | if ($date->format(self::FORMAT_SIMPLE) === $dateString) { |
|
|
|||
28 | 1 | return true; |
|
29 | } |
||
30 | |||
31 | 1 | return false; |
|
32 | } |
||
33 | |||
86 |