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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -48,12 +48,6 @@ enum Month: string
public static function fromNameOrCurrent(string $name): Month
{
$month = Month::tryFrom($name);
if ($month === null) {
return Month::current();
}
return $month;
return Month::tryFrom($name) ?? Month::current();
}
}