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 | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
31 | 76 | private function isDateTime(string $format, string $value): bool |
|
32 | { |
||
33 | $exceptionalFormats = [ |
||
34 | 76 | 'c' => 'Y-m-d\TH:i:sP', |
|
35 | 'r' => 'D, d M Y H:i:s O', |
||
36 | ]; |
||
37 | |||
38 | 76 | $info = date_parse_from_format($exceptionalFormats[$format] ?? $format, $value); |
|
39 | |||
40 | 76 | if (!$this->isDateTimeParsable($info)) { |
|
41 | 30 | return false; |
|
42 | } |
||
43 | |||
44 | 49 | if ($this->isDateFormat($format)) { |
|
45 | 30 | return $this->isDateInformation($info); |
|
46 | } |
||
47 | |||
48 | 19 | return true; |
|
49 | } |
||
70 |