@@ -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
}
@@ -751,7 +751,7 @@ When serializing, you can set a callback to format a specific object property::
751
751
$encoder = new JsonEncoder();
752
752
753
753
// all callback parameters are optional (you can omit the ones you don't use)
754
- $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
754
+ $dateCallback = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
755
755
return $innerObject instanceof \DateTime ? $innerObject->format(\DateTime::ISO8601) : '';
756
756
};
757
757
@@ -1629,7 +1629,7 @@ having unique identifiers::
1629
1629
$classMetadataFactory = new ClassMetadataFactory(new AttributeLoader());
1630
1630
1631
1631
// all callback parameters are optional (you can omit the ones you don't use)
1632
- $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, string $format = null, array $context = []): string {
1632
+ $maxDepthHandler = function (object $innerObject, object $outerObject, string $attributeName, ? string $format = null, array $context = []): string {
1633
1633
return '/foos/'.$innerObject->id;
1634
1634
};
1635
1635
0 commit comments