Skip to content

Commit cd768a5

Browse files
committed
Reflection::$builtinTypes changed to const
1 parent c83e115 commit cd768a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Utils/Reflection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ final class Reflection
1919
{
2020
use Nette\StaticClass;
2121

22-
private static $builtinTypes = [
22+
private const BUILTIN_TYPES = [
2323
'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1,
2424
'callable' => 1, 'iterable' => 1, 'void' => 1,
2525
];
2626

2727

2828
public static function isBuiltinType(string $type): bool
2929
{
30-
return isset(self::$builtinTypes[strtolower($type)]);
30+
return isset(self::BUILTIN_TYPES[strtolower($type)]);
3131
}
3232

3333

@@ -150,7 +150,7 @@ public static function expandClassName(string $name, \ReflectionClass $rc): stri
150150
if (empty($name)) {
151151
throw new Nette\InvalidArgumentException('Class name must not be empty.');
152152

153-
} elseif (isset(self::$builtinTypes[$lower])) {
153+
} elseif (isset(self::BUILTIN_TYPES[$lower])) {
154154
return $lower;
155155

156156
} elseif ($lower === 'self') {

0 commit comments

Comments
 (0)