Update app/Domain/Enums/Month.php

Co-authored-by: Marcin Tracz <marcin.tracz@blumilk.pl>
This commit is contained in:
Adrian Hopek
2022-02-21 15:47:55 +01:00
committed by GitHub
parent 0dfb28d0b3
commit 96192c0f2c

View File

@@ -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;
} }
} }