-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Labels
Description
Hello,
I think I've found a bug when auryn attempts to instantiate an object which is a descendant of \ArrayObject
.
Exception / Stack trace:
PHP Fatal error: Uncaught exception 'InvalidArgumentException' with message 'Passed variable is not an array or object, using empty array instead' in /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php:400
Stack trace:
#0 [internal function]: ArrayObject->__construct(NULL)
#1 /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php(400): ReflectionClass->newInstanceArgs(Array)
#2 /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php(367): Auryn\Injector->provisionInstance('sekjun9878\\Func...', 'sekjun9878\\func...', Array)
#3 /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php(522): Auryn\Injector->make('sekjun9878\\Func...')
#4 /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php(459): Auryn\Injector->buildArgFromTypeHint(Object(ReflectionMethod), Object(ReflectionParameter))
#5 /h in /project/g/php-typechecker/vendor/rdlowrey/auryn/lib/Injector.php on line 400
Class signatures:
final class FunctionDirectory extends Directory
abstract class Directory extends \ArrayObject
Workaround:
//$functionDirectory = $injector->make(FunctionDirectory::class);
$functionDirectory = new FunctionDirectory;
$injector->share($functionDirectory);