diff --git a/src/utils/EnumTrait.php b/src/utils/EnumTrait.php index 40057b9ea..fd927a203 100644 --- a/src/utils/EnumTrait.php +++ b/src/utils/EnumTrait.php @@ -70,7 +70,7 @@ trait EnumTrait{ * @throws \InvalidArgumentException */ private function __construct(string $enumName){ - if(preg_match('/^\D[A-Za-z\d_]+$/u', $enumName, $matches) === 0){ + if(preg_match('/^(?!\d)[A-Za-z\d_]+$/u', $enumName, $matches) === 0){ throw new \InvalidArgumentException("Invalid enum member name \"$enumName\", should only contain letters, numbers and underscores, and must not start with a number"); } $this->enumName = $enumName;