Handle null input in fromNormalized method

Updated the `fromNormalized` method to return null when provided with a null input. This ensures better handling of edge cases and prevents potential errors from null data.
This commit is contained in:
Julien Fastré 2025-04-08 15:49:04 +02:00
parent f683e45b6e
commit e0f94ae900
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -100,8 +100,12 @@ class RollingDate
];
}
public static function fromNormalized(array $data): self
public static function fromNormalized(?array $data): ?self
{
if (null === $data) {
return null;
}
if (1 === $data['v']) {
return new self(
$data['roll'],