You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $piece)) {
33
51
$errorMessage = $errorMessage ?: sprintf('"%s" is not valid as a PHP class name (it must start with a letter or underscore, followed by any number of letters, numbers, or underscores)', $className);
34
52
35
53
thrownewRuntimeCommandException($errorMessage);
36
54
}
55
+
56
+
if (\in_array(strtolower($shortClassName), $reservedKeywords, true)) {
57
+
thrownewRuntimeCommandException(sprintf('"%s" is a reserved keyword and thus cannot be used as class name in PHP.', $shortClassName));
$this->expectExceptionMessage('"class" is not valid as a PHP class name (it must start with a letter or underscore, followed by any number of letters, numbers, or underscores)');
63
-
Validator::validateClassName('class');
62
+
$this->expectExceptionMessage('"Class" is a reserved keyword and thus cannot be used as class name in PHP.');
0 commit comments