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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you call Injector->execute on a function, and it requires a non-typehinted param which has not been defined, the error message is generated with the code:
$declaringClass = $param->getDeclaringClass()->getName();
throw new InjectionException(
sprintf($this->errorMessages[self::E_UNDEFINED_PARAM], $declaringClass,$param->name),
self::E_UNDEFINED_PARAM
);
This can be replicated with the code:
$provider = new \Auryn\Provider();
$provider->execute('functionMissingParamDefine');
exit(0);
$param->getDeclaringClass() does not always work as you would expect. If execute is called from within another class it returns that classes name. e.g. if you put the above code in a test case inside ProviderTest, it returns ProviderTest.
I encountered this by as it returns null when the execute is called from outside a class.
I will fix this when I've re-merged my code with Levi's ninja reorganisation.
The text was updated successfully, but these errors were encountered:
Just to note once again, the test needs to be run outside of a class - which is why there is now a test in the bootstrap. If anyone has a better way of organising this, I am all ears.
When you call Injector->execute on a function, and it requires a non-typehinted param which has not been defined, the error message is generated with the code:
This can be replicated with the code:
$param->getDeclaringClass() does not always work as you would expect. If execute is called from within another class it returns that classes name. e.g. if you put the above code in a test case inside ProviderTest, it returns ProviderTest.
I encountered this by as it returns null when the execute is called from outside a class.
I will fix this when I've re-merged my code with Levi's ninja reorganisation.
The text was updated successfully, but these errors were encountered: