We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 7 |
Paths | 4 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 56 |
Changes | 0 |
1 | <?php |
||
37 | private function toComparable($value) |
||
38 | { |
||
39 | if ($value instanceof DateTimeInterface || !is_string($value) || is_numeric($value) || empty($value)) { |
||
40 | return $value; |
||
41 | } |
||
42 | |||
43 | if (1 === mb_strlen($value)) { |
||
44 | return $value; |
||
45 | } |
||
46 | |||
47 | try { |
||
48 | return new DateTimeImmutable($value); |
||
49 | } catch (Exception $e) { |
||
50 | return $value; |
||
51 | } |
||
54 |