We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
| Conditions | 4 |
| Paths | 4 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 48 | 37 | public function validate($input): bool |
|
| 49 | { |
||
| 50 | 37 | if ($input instanceof DateTimeInterface) { |
|
| 51 | 4 | return null === $this->format; |
|
| 52 | } |
||
| 53 | |||
| 54 | 33 | if (!is_scalar($input)) { |
|
| 55 | 2 | return false; |
|
| 56 | } |
||
| 57 | |||
| 58 | 31 | if (null === $this->format) { |
|
| 59 | 12 | return false !== strtotime((string) $input); |
|
| 60 | } |
||
| 61 | |||
| 62 | 19 | return $this->isDateTime($this->format, (string) $input); |
|
| 63 | } |
||
| 65 |