Fix type error
This commit is contained in:
@@ -28,8 +28,10 @@ final class Badge
|
||||
{
|
||||
if (null !== $colour) {
|
||||
|
||||
if (!in_array($colour, EnumBadge::cases())) {
|
||||
throw new \RuntimeException(sprintf('"%s" is not a valid Badge colour. Available options are: %s', $colour, implode(", ", EnumBadge::cases())));
|
||||
$cases = array_map(fn(EnumBadge $b) => $b->name, EnumBadge::cases());
|
||||
|
||||
if (!in_array($colour, $cases)) {
|
||||
throw new \RuntimeException(sprintf('"%s" is not a valid Badge colour. Available options are: %s', $colour, implode(", ", $cases)));
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user