Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function convertToPHPValue($value, AbstractPlatform $platform): ?\DateTimeInterface |
||
34 | { |
||
35 | if (null === $value || $value instanceof \DateTimeInterface) { |
||
36 | return $value; |
||
37 | } |
||
38 | |||
39 | $converted = \DateTime::createFromFormat($platform->getDateTimeFormatString(), $value, $this->getUTC()); |
||
40 | |||
41 | if (!$converted) { |
||
42 | throw ConversionException::conversionFailedFormat($value, $this->getName(), $platform->getDateTimeFormatString()); |
||
43 | } |
||
44 | |||
45 | return $converted; |
||
46 | } |
||
47 | |||
57 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.