Total Complexity | 5 |
Total Lines | 40 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
14 | class Date extends ScalarType |
||
15 | { |
||
16 | private const FORMAT = 'Y-m-d'; |
||
17 | |||
18 | /** @var string */ |
||
19 | public $name = 'Date'; |
||
20 | |||
21 | /** @var string */ |
||
22 | public $description = 'A date string with format Y-m-d. Example: "2018-01-01"'; |
||
23 | |||
24 | /** |
||
25 | * @inheritdoc |
||
26 | */ |
||
27 | public function serialize($value) |
||
28 | { |
||
29 | return $value->format(self::FORMAT); |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | public function parseValue($value) |
||
41 | } |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * @inheritdoc |
||
46 | */ |
||
47 | public function parseLiteral($valueNode, array $variables = null) |
||
56 |