Skip to content
Permalink
Browse files

Reflection: added 'null' to builtin types (in fact it is reserved typ…

…e since PHP 7.0)
  • Loading branch information...
dg committed Mar 15, 2019
1 parent 574e1f3 commit d339ba9b94979ce9c9d590974f4b746bd8e15bf3
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/Utils/Reflection.php
  2. +1 −1 tests/Utils/Reflection.expandClassName.phpt
@@ -21,7 +21,7 @@ final class Reflection
private const BUILTIN_TYPES = [
'string' => 1, 'int' => 1, 'float' => 1, 'bool' => 1, 'array' => 1, 'object' => 1,
'callable' => 1, 'iterable' => 1, 'void' => 1,
'callable' => 1, 'iterable' => 1, 'void' => 1, 'null' => 1,
];
@@ -35,7 +35,7 @@ Assert::same('BTest', Reflection::expandClassName('BTest', $rcBTest));
Assert::same('Test\Space\Foo', Reflection::expandClassName('self', $rcFoo));
Assert::same('Test\Space\Foo', Reflection::expandClassName('Self', $rcFoo));
foreach (['String', 'string', 'int', 'float', 'bool', 'array', 'callable', 'iterable', 'void'] as $type) {
foreach (['String', 'string', 'int', 'float', 'bool', 'array', 'callable', 'iterable', 'void', 'null'] as $type) {
Assert::same(strtolower($type), Reflection::expandClassName($type, $rcFoo));
}

0 comments on commit d339ba9

Please sign in to comment.
You can’t perform that action at this time.
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.