Update app/Domain/Enums/Month.php
Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl>
This commit is contained in:
parent
0dfb28d0b3
commit
96192c0f2c
@ -48,12 +48,6 @@ enum Month: string
|
|||||||
|
|
||||||
public static function fromNameOrCurrent(string $name): Month
|
public static function fromNameOrCurrent(string $name): Month
|
||||||
{
|
{
|
||||||
$month = Month::tryFrom($name);
|
return Month::tryFrom($name) ?? Month::current();
|
||||||
|
|
||||||
if ($month === null) {
|
|
||||||
return Month::current();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $month;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user