mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
Drop some obviously useless static function variables
these are better suited as constant literals.
This commit is contained in:
@ -82,8 +82,7 @@ trait EnumTrait{
|
||||
* @throws \InvalidArgumentException
|
||||
*/
|
||||
private function __construct(string $enumName){
|
||||
static $pattern = '/^\D[A-Za-z\d_]+$/u';
|
||||
if(preg_match($pattern, $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;
|
||||
|
Reference in New Issue
Block a user