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 |
||
| 53 | 29 | public function validate($input): bool |
|
| 54 | { |
||
| 55 | 29 | if ($input instanceof DateTimeInterface) { |
|
| 56 | 4 | return null === $this->format; |
|
| 57 | } |
||
| 58 | |||
| 59 | 25 | if (!is_scalar($input)) { |
|
| 60 | 2 | return false; |
|
| 61 | } |
||
| 62 | |||
| 63 | 23 | if (null === $this->format) { |
|
| 64 | 12 | return false !== strtotime((string) $input); |
|
| 65 | } |
||
| 66 | |||
| 67 | 11 | return $this->isValidDateTime($this->format, (string) $input); |
|
| 68 | } |
||
| 70 |