Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
45 | public function verify($value): ?\DateTimeInterface |
||
46 | { |
||
47 | if ($value === null) { |
||
48 | return null; |
||
49 | } |
||
50 | |||
51 | if ($value instanceof \DateTimeInterface) { |
||
52 | return $value; |
||
53 | } |
||
54 | |||
55 | $error = 'Input CarbonDateTime scalar should be compatible with String or Int scalar type'; |
||
56 | throw new InvalidDateTimeFormat($error); |
||
57 | } |
||
58 | } |
||
59 |