mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
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:
parent
f683e45b6e
commit
e0f94ae900
@ -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']) {
|
if (1 === $data['v']) {
|
||||||
return new self(
|
return new self(
|
||||||
$data['roll'],
|
$data['roll'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user