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 | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | 33 | public function validate($input) |
|
| 31 | { |
||
| 32 | 33 | if ($input instanceof DateTimeInterface) { |
|
| 33 | 2 | return true; |
|
| 34 | } |
||
| 35 | |||
| 36 | 31 | if (!is_scalar($input)) { |
|
| 37 | return false; |
||
| 38 | } |
||
| 39 | |||
| 40 | 31 | if (is_null($this->format)) { |
|
| 41 | 5 | return $this->validateWithoutFormat($input); |
|
| 42 | } |
||
| 43 | |||
| 44 | 26 | return $this->validateWithFormat($input, $this->format); |
|
| 45 | } |
||
| 46 | |||
| 63 |