Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[HttpKernel] Fix service arg resolver for controllers as array callables#24970
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
xabbuh left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
a test would be nice :)
weaverryan commentedNov 14, 2017
Aren't workshops useful? And yea... this important class doesn't have a test at all yet. Maybe we should add one at lunch tomorrow ;) |
Simperfit commentedNov 15, 2017 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@weaverryan Maybe we should keep that kind of contribution (the tests) for the hackday in 3 days ? |
sroze commentedNov 15, 2017
Created tests for the existing behaviour plus the failing test in here:#24972 |
nicolas-grekas commentedNov 15, 2017
Closing in favor of#24972 |
…rray callables (sroze, nicolas-grekas)This PR was merged into the 3.4 branch.Discussion----------[HttpKernel] Fix service arg resolver for controllers as array callables| Q | A| ------------- | ---| Branch? | 3.4| Bug fix? | yes| New feature? | no| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets |#24970| License | MIT| Doc PR | øReplacing#24970 as I can't push tests directly to@nicolas-grekas' PR.> As spotted today during a Symfony 4 workshop at SymfonyCon Cluj, setting a controller as an array [SomeController::class, 'helloAction'] works, it is defined as a service, BUT the actions don't get the services as arguments. This is fixing it.Commits-------fc3d3bb [HttpKernel] Fix service arg resolver for controllers as array callablesa9e9f36 Add service value resolver tests Prove that the service value resolver will not work with the array notation
As spotted today during a Symfony 4 workshop at SymfonyCon Cluj, setting a controller as an array
[SomeController::class, 'helloAction']works, it is defined as a service, BUT the actions don't get the services as arguments. This is fixing it.