File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -111,12 +111,8 @@ private static function assertValidName(string $name): void
111
111
throw new InvalidArgumentException ("A name cannot be an empty string " );
112
112
}
113
113
114
- if (!preg_match ('/^\p{L}[\p{L}0-9_]*$/u ' , $ name )) {
115
- throw new InvalidArgumentException ('A name can only contain alphanumeric characters and underscores ' );
116
- }
117
-
118
- if (is_numeric ($ name [0 ])) {
119
- throw new InvalidArgumentException ('A name cannot begin with a numeric character ' );
114
+ if (!preg_match ('/^\p{L}[\p{L}\d_]*$/u ' , $ name )) {
115
+ throw new InvalidArgumentException ('A name can only contain alphanumeric characters and underscores and must begin with an alphanumeric character ' );
120
116
}
121
117
122
118
if (strlen ($ name ) >= 65535 ) {
You can’t perform that action at this time.
0 commit comments