1 | <?php |
||
19 | final class DateTimeScalar extends ScalarDefinition |
||
20 | { |
||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | public const TYPE_NAME = 'DateTime'; |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | public const TYPE_DESCRIPTION = 'The DateTime scalar conforms to the RFC 3339 profile of the ISO 8601 standard.'; |
||
30 | |||
31 | /** |
||
32 | * BooleanScalar constructor. |
||
33 | * @param Document $document |
||
34 | */ |
||
35 | 9 | public function __construct(Document $document) |
|
41 | |||
42 | /** |
||
43 | * @param mixed $value |
||
44 | * @return \DateTimeInterface |
||
45 | * @throws TypeConflictException |
||
46 | */ |
||
47 | public function parse($value): \DateTimeInterface |
||
59 | |||
60 | /** |
||
61 | * @param mixed $value |
||
62 | * @return string |
||
63 | * @throws TypeConflictException |
||
64 | */ |
||
65 | public function serialize($value): string |
||
78 | |||
79 | /** |
||
80 | * @param string $value |
||
81 | * @return \DateTimeInterface |
||
82 | * @throws TypeConflictException |
||
83 | */ |
||
84 | private function parseDateTime(string $value): \DateTimeInterface |
||
94 | |||
95 | /** |
||
96 | * @return int |
||
97 | */ |
||
98 | public function getLine(): int |
||
102 | |||
103 | /** |
||
104 | * @return bool |
||
105 | */ |
||
106 | public function isBuiltin(): bool |
||
110 | } |
||
111 |