Skip to content

Commit 03f07bb

Browse files
authored
Merge pull request overblog#370 from yoannrenard/improve_doc_scalars
Improve doc on Scalar types
2 parents 9e2424d + 38358e5 commit 03f07bb

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/definitions/type-system/scalars.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,33 +33,33 @@ use GraphQL\Language\AST\Node;
3333
class DateTimeType
3434
{
3535
/**
36-
* @param \DateTime $value
36+
* @param \DateTimeInterface $value
3737
*
3838
* @return string
3939
*/
40-
public static function serialize(\DateTime $value)
40+
public static function serialize(\DateTimeInterface $value)
4141
{
4242
return $value->format('Y-m-d H:i:s');
4343
}
4444

4545
/**
4646
* @param mixed $value
4747
*
48-
* @return mixed
48+
* @return \DateTimeInterface
4949
*/
5050
public static function parseValue($value)
5151
{
52-
return new \DateTime($value);
52+
return new \DateTimeImmutable($value);
5353
}
5454

5555
/**
5656
* @param Node $valueNode
5757
*
58-
* @return string
58+
* @return \DateTimeInterface
5959
*/
60-
public static function parseLiteral($valueNode)
60+
public static function parseLiteral(Node $valueNode)
6161
{
62-
return new \DateTime($valueNode->value);
62+
return new \DateTimeImmutable($valueNode->value);
6363
}
6464
}
6565
```

0 commit comments

Comments
 (0)