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