Skip to content

Commit 8eed052

Browse files
committed
Reflection: added 'null' to builtin types (in fact it is reserved type since PHP 7.0)
1 parent 5ee5c38 commit 8eed052

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Utils/Reflection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class Reflection
2121

2222
private const BUILTIN_TYPES = [
2323
'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1,
24-
'callable' => 1, 'iterable' => 1, 'void' => 1,
24+
'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1,
2525
];
2626

2727

tests/Utils/Reflection.expandClassName.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Assert::same('BTest', Reflection::expandClassName('BTest', $rcBTest));
3535
Assert::same('Test\Space\Foo', Reflection::expandClassName('self', $rcFoo));
3636
Assert::same('Test\Space\Foo', Reflection::expandClassName('Self', $rcFoo));
3737

38-
foreach (['String', 'string', 'int', 'float', 'bool', 'array', 'callable', 'iterable', 'void'] as $type) {
38+
foreach (['String', 'string', 'int', 'float', 'bool', 'array', 'callable', 'iterable', 'void', 'null'] as $type) {
3939
Assert::same(strtolower($type), Reflection::expandClassName($type, $rcFoo));
4040
}
4141

0 commit comments

Comments
 (0)