Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[FrameworkBundle] Improve DX of RedirectController#25259
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
dunglas commentedDec 2, 2017
Status: needs review |
ro0NL commentedDec 2, 2017
isnt adding a single test to cover the method forwarding simpler? |
dunglas commentedDec 2, 2017
Well doing that allowed me to find some bugs in my forwarding logic. So I would prefer to keep al the tests. |
sroze commentedDec 3, 2017
Maybe that's not that useful if we go with this PR that allows redirection to be set directly in the routing configuration? |
dunglas commentedDec 3, 2017
@sroze IMO we must have an invoke method for all builtin controllers. |
| publicfunction__invoke(Request$request):Response | ||
| { | ||
| if (null !==$route =$request->attributes->get('route')) { |
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.
That looks like alot of magic. It might be cleaner to just create a new controller with invoke for one action. And possibly deprecate it in RedirectController so there is no ambiguity.
This PR was merged into the 4.1-dev branch.Discussion----------[DI] Allow for invokable event listeners| Q | A| ------------- | ---| Branch? | master| Bug fix? | no| New feature? | yes| BC breaks? | no| Deprecations? | no| Tests pass? | yes| Fixed tickets | #... <!-- #-prefixed issue number(s), if any -->| License | MIT| Doc PR | symfony/symfony-docs#... <!--highly recommended for new features-->Inspired by#24637 /#25259. This adds invokable support for event listeners :)```yamlSome\Foo: tags: [{ name: kernel.event_listener, event: kernel.request }]``````phpclass Foo { public function __invoke(GetResponseEvent $event) { }}```Commits-------fa5b7eb [DI] Allow for invokable event listeners
nicolas-grekas commentedMar 22, 2018
I'm not convinced this provides anything. Actually, I'm much more convinced by the aliasing discussed in#25145 (comment) 👎 |
fabpot commentedMar 27, 2018
I don't see why wemust provide an |
Uh oh!
There was an error while loading.Please reload this page.
Similar to#24637 but for redirect controller.
TODO: