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 |
||
| 30 | 16 | protected function filterInterval($value) |
|
| 31 | { |
||
| 32 | 16 | if (!is_string($value) || is_numeric($value) || empty($value)) { |
|
| 33 | 13 | return $value; |
|
| 34 | } |
||
| 35 | |||
| 36 | 11 | if (1 == mb_strlen($value)) { |
|
| 37 | 3 | return $value; |
|
| 38 | } |
||
| 39 | |||
| 40 | try { |
||
| 41 | 9 | return new DateTimeImmutable($value); |
|
| 42 | 2 | } catch (Exception $e) { |
|
| 43 | // Pokémon Exception Handling |
||
| 44 | } |
||
| 45 | |||
| 46 | 2 | return $value; |
|
| 47 | } |
||
| 48 | } |
||
| 49 |