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
DI\Definition\Exception\DefinitionException: Parameter with name 'roles' could not be found. Class Rbac\*RouteGuard does not exist. Full definition: Object ( class = #UNKNOWN# Rbac\*RouteGuard scope = singleton lazy = false ) in /var/www/cms/vendor/php-di/php-di/src/DI/Definition/Exception/DefinitionException.php on line 16
Now, if i keep trying with a wildcard but using the constructor() method instead of constructorParameter() everything works again :
The parameter is resolved early, before we get the real class name. So it's trying to look for the parameter in the Rbac\*RouteGuard class (as it says in the error message), and the class doesn't exist so it fails.
🤔 I'm not sure how to fix that right now, I'll try to have a look for v6.
Alright, thanks for the quick answer, i'll try to work around that for now.
jhuet
changed the title
DI\object()->constructorParameter() doesn't seem to work with wildcards definitions
DI\object()->constructorParameter() doesn't work with wildcards definitions
Dec 4, 2017
I'm testing with 3 different definitions.
This first one works as expected :
For convenience, i wanted to try the wildcard approach to not have to repeat the definition :
Unfortunatly, i'm then getting this exception :
Now, if i keep trying with a wildcard but using the
constructor()
method instead ofconstructorParameter()
everything works again :For the record, here's the contructor definition of
Rbac\ArticleRouteGuard
:Is there something i'm missing here or is wildcard +
constructorParameter()
not supported ?Thanks.
The text was updated successfully, but these errors were encountered: