@@ -118,7 +118,7 @@ exists in your project::
118
118
$this->sportsperson = $sportsperson;
119
119
}
120
120
121
- public function setCreatedAt(\DateTimeInterface $createdAt = null): void
121
+ public function setCreatedAt(? \DateTimeInterface $createdAt = null): void
122
122
{
123
123
$this->createdAt = $createdAt;
124
124
}
@@ -723,7 +723,7 @@ When serializing, you can set a callback to format a specific object property::
723
723
$encoder = new JsonEncoder();
724
724
725
725
// all callback parameters are optional (you can omit the ones you don't use)
726
- $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
726
+ $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
727
727
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
728
728
};
729
729
@@ -1574,7 +1574,7 @@ having unique identifiers::
1574
1574
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
1575
1575
1576
1576
// all callback parameters are optional (you can omit the ones you don't use)
1577
- $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
1577
+ $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
1578
1578
return '/foos/'.$innerObject->id;
1579
1579
};
1580
1580
0 commit comments