Skip to content

Commit febcc41

Browse files
committed
PhpNamespace: $keyword => const KEYWORDS
1 parent 5abae40 commit febcc41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PhpGenerator/PhpNamespace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ final class PhpNamespace
2626
{
2727
use Nette\SmartObject;
2828

29-
private static $keywords = [
29+
private const KEYWORDS = [
3030
'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1,
3131
'callable' => 1, 'iterable' => 1, 'void' => 1, 'self' => 1, 'parent' => 1,
3232
];
@@ -122,7 +122,7 @@ public function getUses(): array
122122

123123
public function unresolveName(string $name): string
124124
{
125-
if (isset(self::$keywords[strtolower($name)]) || $name === '') {
125+
if (isset(self::KEYWORDS[strtolower($name)]) || $name === '') {
126126
return $name;
127127
}
128128
$name = ltrim($name, '\\');

0 commit comments

Comments
 (0)