79323438

Date: 2025-01-02 10:38:25
Score: 3.5
Natty:
Report link

I can't comment on Duncanmoo's response since I have no reputation yet.

But in PHP 8.4, you can simplify it to

public static function tryFromName(string $name): ?static
{
  return array_find(self::cases(), fn($case) => $case->name === $name);
}
Reasons:
  • RegEx Blacklisted phrase (1): can't comment
  • RegEx Blacklisted phrase (1.5): reputation
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Bryan Zarzuela