Conditions | 3 |
Paths | 3 |
Total Lines | 11 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
24 | 2 | public function convertToDatabaseValue(mixed $value, AbstractPlatform $platform): ?string |
|
25 | 1 | { |
|
26 | if ($value === null) { |
||
27 | return $value; |
||
28 | 1 | } |
|
29 | |||
30 | if ($value instanceof DateTimeInterface) { |
||
31 | return $value->format($platform->getDateTimeFormatString()); |
||
32 | } |
||
33 | |||
34 | 2 | throw InvalidType::new($value, self::class, ['null', 'Chronos']); |
|
35 | } |
||
59 |