We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
Conditions | 6 |
Paths | 4 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 8 |
CRAP Score | 6 |
Changes | 0 |
1 | <?php |
||
28 | 16 | protected function filterInterval($value) |
|
29 | { |
||
30 | 16 | if (!is_string($value) || is_numeric($value) || empty($value)) { |
|
31 | 13 | return $value; |
|
32 | } |
||
33 | |||
34 | 11 | if (mb_strlen($value) == 1) { |
|
35 | 3 | return $value; |
|
36 | } |
||
37 | |||
38 | try { |
||
39 | 9 | return new DateTimeImmutable($value); |
|
40 | 2 | } catch (Exception $e) { |
|
41 | // Pokémon Exception Handling |
||
42 | } |
||
43 | |||
44 | 2 | return $value; |
|
45 | } |
||
46 | } |
||
47 |