Total Complexity | 6 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | final class DateTimeType extends ScalarType |
||
15 | { |
||
16 | public function parseLiteral($valueNode, ?array $variables = null) |
||
25 | } |
||
26 | |||
27 | public function parseValue(mixed $value): DateTimeImmutable |
||
28 | { |
||
29 | if (!is_string($value)) { |
||
30 | throw new UnexpectedValueException('Cannot represent value as DateTime date: ' . Utils::printSafe($value)); |
||
31 | } |
||
32 | |||
33 | return new DateTimeImmutable($value); |
||
34 | } |
||
35 | |||
36 | public function serialize(mixed $value): mixed |
||
43 | } |
||
44 | } |
||
45 |