Conditions | 4 |
Paths | 4 |
Total Lines | 17 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 4.0312 |
Changes | 0 |
1 | <?php |
||
34 | public function isDateTimeValid(string $dateString): bool |
||
35 | { |
||
36 | 1 | if (!$this->isValidDateTimeAgainstRegex($dateString)) { |
|
37 | 1 | return false; |
|
38 | } |
||
39 | |||
40 | 1 | $date = $this->createDateTimeFromString($dateString); |
|
41 | 1 | if (false === $date) { |
|
42 | return false; |
||
43 | } |
||
44 | |||
45 | 1 | if ($date->format(self::FORMAT_RFC3339) === $dateString) { |
|
46 | 1 | return true; |
|
47 | } |
||
48 | |||
49 | 1 | return false; |
|
50 | } |
||
51 | |||
86 |