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 | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 42 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | protected function filterInterval($value) |
||
| 31 | { |
||
| 32 | if (!is_string($value) || is_numeric($value) || empty($value)) { |
||
| 33 | return $value; |
||
| 34 | } |
||
| 35 | |||
| 36 | if (1 == mb_strlen($value)) { |
||
| 37 | return $value; |
||
| 38 | } |
||
| 39 | |||
| 40 | try { |
||
| 41 | return new DateTimeImmutable($value); |
||
| 42 | } catch (Exception $e) { |
||
| 43 | // Pokémon Exception Handling |
||
| 44 | } |
||
| 45 | |||
| 46 | return $value; |
||
| 47 | } |
||
| 49 |