Skip to content

Commit

Permalink
Fixed nullable object in the method `CompositeValueObjectTrait::toNat…
Browse files Browse the repository at this point in the history
…ive()`
  • Loading branch information
tg666 committed Dec 13, 2024
1 parent 35b923e commit 4dceb18
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static function fromSafeNative(mixed $native): static
*/
public function toNative(): array
{
return array_map(static fn (ValueObjectInterface $valueObject): mixed => $valueObject->toNative(), $this->propertiesToArray());
return array_map(static fn (?ValueObjectInterface $valueObject): mixed => $valueObject?->toNative(), $this->propertiesToArray());
}

public function equals(ValueObjectInterface $object): bool
Expand Down

0 comments on commit 4dceb18

Please sign in to comment.