-
Notifications
You must be signed in to change notification settings - Fork 155
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
Add autowire for resource Controllers #255
Conversation
AdamKasp
commented
Jan 14, 2021
Q | A |
---|---|
Bug fix? | no? |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
License | MIT |
a39e191
to
38465a2
Compare
11fbc28
to
994666a
Compare
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.
lint:container
command should be added to pipeline
994666a
to
a5b83f0
Compare
937e0e5
to
adbbfc3
Compare
Hey Loic, In addition, with this fix, you will be able to use the FQCN of controllers in routing: app_book_sortable_index:
path: /sortable-books/
methods: [GET]
defaults:
_controller: \App\Controller\BookController:indexAction
_sylius:
sortable: true @AdamKasp can you add config to your PR? It should be changed in |
src/Bundle/DependencyInjection/Compiler/RegisterControllerAliasesPass.php
Outdated
Show resolved
Hide resolved
@lchrusciel Yes, I just wanted you have this little hook on your mind :) |
adbbfc3
to
c6e7f61
Compare
1eb7982
to
bce1f68
Compare
src/Bundle/Tests/DependencyInjection/Compiler/RegisterFQCNControllersPassTest.php
Outdated
Show resolved
Hide resolved
src/Bundle/Tests/DependencyInjection/Compiler/RegisterFQCNControllersPassTest.php
Outdated
Show resolved
Hide resolved
src/Bundle/DependencyInjection/Compiler/RegisterFQCNControllersPass.php
Outdated
Show resolved
Hide resolved
if ($controllerFQCN !== ResourceController::class) { | ||
$definition = $container->getDefinition($metadata->getServiceId('controller')); | ||
|
||
// TODO: Change to alias definition after bumping to > Symfony 5.2 |
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.
Why can't we use aliases in Symfony 4.4?
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.
Because we need here public aliases which will be provided in Symfony 5.2
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.
It's available in Symfony 5.1 as well.
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.
Could we change the comment? Or maybe put some if to find out if Symfony 5.1 is installed and then using an alias instead of copied definition?
src/Bundle/DependencyInjection/Compiler/RegisterFQCNControllersPass.php
Outdated
Show resolved
Hide resolved
src/Bundle/Tests/DependencyInjection/Compiler/RegisterFQCNControllersPassTest.php
Outdated
Show resolved
Hide resolved
src/Bundle/Tests/DependencyInjection/Compiler/RegisterFQCNControllersPassTest.php
Outdated
Show resolved
Hide resolved
482e667
to
34526d7
Compare
src/Bundle/Tests/DependencyInjection/Compiler/RegisterFqcnControllersPassTest.php
Show resolved
Hide resolved
34526d7
to
24ce5fb
Compare
Thanks, Adam! 🎉 |