| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 40 | 5 | public function convertToDatabaseValue($value, AbstractPlatform $platform): ?string |
|
| 41 | { |
||
| 42 | 5 | if (null === $value) { |
|
| 43 | 1 | return $value; |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | if ($value instanceof DateTimeInterface) { |
|
| 47 | 3 | return $value->format($platform->getDateTimeFormatString()); |
|
| 48 | } |
||
| 49 | |||
| 50 | 1 | throw ConversionException::conversionFailedInvalidType( |
|
| 51 | 1 | $value, |
|
| 52 | 1 | $this->getName(), |
|
| 53 | 1 | ['null', DateTimeInterface::class], |
|
| 54 | ); |
||
| 57 |