@@ -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
}
@@ -756,7 +756,7 @@ When serializing, you can set a callback to format a specific object property::
756
756
$encoder = new JsonEncoder();
757
757
758
758
// all callback parameters are optional (you can omit the ones you don't use)
759
- $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
759
+ $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
760
760
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
761
761
};
762
762
@@ -1613,7 +1613,7 @@ having unique identifiers::
1613
1613
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
1614
1614
1615
1615
// all callback parameters are optional (you can omit the ones you don't use)
1616
- $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
1616
+ $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
1617
1617
return '/foos/'.$innerObject->id;
1618
1618
};
1619
1619
0 commit comments