File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
docs/definitions/type-system Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -33,33 +33,33 @@ use GraphQL\Language\AST\Node;
33
33
class DateTimeType
34
34
{
35
35
/**
36
- * @param \DateTime $value
36
+ * @param \DateTimeInterface $value
37
37
*
38
38
* @return string
39
39
*/
40
- public static function serialize(\DateTime $value)
40
+ public static function serialize(\DateTimeInterface $value)
41
41
{
42
42
return $value->format('Y-m-d H:i:s');
43
43
}
44
44
45
45
/**
46
46
* @param mixed $value
47
47
*
48
- * @return mixed
48
+ * @return \DateTimeInterface
49
49
*/
50
50
public static function parseValue($value)
51
51
{
52
- return new \DateTime ($value);
52
+ return new \DateTimeImmutable ($value);
53
53
}
54
54
55
55
/**
56
56
* @param Node $valueNode
57
57
*
58
- * @return string
58
+ * @return \DateTimeInterface
59
59
*/
60
- public static function parseLiteral($valueNode)
60
+ public static function parseLiteral(Node $valueNode)
61
61
{
62
- return new \DateTime ($valueNode->value);
62
+ return new \DateTimeImmutable ($valueNode->value);
63
63
}
64
64
}
65
65
```
You can’t perform that action at this time.
0 commit comments