| Conditions | 5 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 26 | public function deserializeDateTimeFromJson(JsonDeserializationVisitor $visitor, $data, array $type) |
||
| 27 | { |
||
| 28 | if ('' === $data || null === $data || '0000-00-00 00:00:00' === $data) { |
||
| 29 | return null; |
||
| 30 | } |
||
| 31 | |||
| 32 | // We want to always show the response in the UTC timezone. |
||
| 33 | $dateTime = parent::deserializeDateTimeFromJson($visitor, $data, $type); |
||
| 34 | |||
| 35 | if ($dateTime instanceof \DateTime) { |
||
| 36 | $dateTime->setTimezone(new \DateTimeZone('UTC')); |
||
| 37 | } |
||
| 38 | |||
| 39 | return $dateTime; |
||
| 40 | } |
||
| 41 | } |
||
| 42 |