-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support ServiceControllerServiceProvider #7
Comments
Hi! Right I see what you mean thanks for the details. I'm curious as to why you would use the Anyway this PR might help: PHP-DI/Invoker#2 With this, we could use $parameterResolver = new ResolverChain([
new AssociativeArrayResolver,
new TypeHintContainerResolver($this->wrapperContainer),
]); That would be an even simpler invoker (so faster, more predictable, …) and we could use it directly. |
You are right and it's not me using the Thanks for your suggestions :) |
I just pushed a first version that implements However, this does not work with controllers that need to be resolved from the container. We would need PHP-DI/Invoker#2 for this, so is there anything preventing it to be merged? |
👍 I'll rebase PHP-DI/Invoker#2 and try to merge it |
@jdreesen rebasing was too painful ;) I created a new PR and merged it: https://github.com/PHP-DI/Invoker/releases/tag/1.2.0 |
Very nice, thx! :) I don't have free time until next week but then I'll update my commit and send a PR. |
The Silex bridge cannot be used together with
Silex\Provider\ServiceControllerServiceProvider
because it always returns an empty array inControllerResolverInterface::getArguments()
.The
ServiceControllerServiceProvider
decorates theControllerResolver
of the app, so that theControllerResolver::getController()
method of this bridge gets only called if the controller is no Silex service. If it is, onlyControllerResolver::getArguments()
of this bridge gets called, which always returns an empty array and thus the controller action will be called without arguments, resulting in an error.It seems that we'd need an instance of
Invoker\ParameterResolver\ParameterResolver
to resolve the parameters of the controller but I don't know how to get it from the container because it's private.The text was updated successfully, but these errors were encountered: