-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Update compiler_passes.rst #9676
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
Conversation
I think that `findDefinition` is better than `getDefinition` as it will also look at aliases. I found it myself while migrating from sf < 3.4 to sf >= 3.4. In particular I was following [this](https://symfony.com/doc/current/service_container/3.3-di-changes.html) and at point 2 services managed directly by `CompilerPass` were never founded. Moreover - not related directly to this PR - I'm not sure that this "split" `getDefinition`/`findDefinition`/`getAlias` is really useful, but maybe I don't have the bigger picture. WDYT?
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.
Well spotted! Thanks for fixing it.
@javiereguiluz Do you thing we should also point it out here? |
I'm afraid I don't understand you. Where exactly do you want to do the change? Thanks! |
I would let users aware that, when changing services id(s) from dot notation to FQCN, if any of those services are handled by a compiler pass that leverage on |
@DonCallisto thanks for explaining it! Let's do that change too then. |
I'll do that in the next hours |
I saw that you made the other related change in a separate pull request, so let's merge this! Thank you. |
This PR was submitted for the 4.0 branch but it was merged into the 3.4 branch instead (closes #9676). Discussion ---------- Update compiler_passes.rst I think that `findDefinition` is better than `getDefinition` as it will also look at aliases. I found this by myself while migrating from sf < 3.4 to sf >= 3.4. In particular I was following [this](https://symfony.com/doc/current/service_container/3.3-di-changes.html) and at point 2 services managed directly by `CompilerPass` were never founded. Moreover - not related directly to this PR - I'm not sure that this "split" `getDefinition`/`findDefinition`/`getAlias` is really useful, but maybe I don't have the bigger picture. WDYT? PS.: Maybe this edit could be applied not only for sf 4 but also for previous versions? Commits ------- 9b26fce Update compiler_passes.rst
This PR was submitted for the 4.0 branch but it was squashed and merged into the 3.4 branch instead (closes #9695). Discussion ---------- Update 3.3-di-changes.rst Related to #9676 (review) Commits ------- bebe9a0 Update 3.3-di-changes.rst
I think that
findDefinition
is better thangetDefinition
as it will also look at aliases.I found this by myself while migrating from sf < 3.4 to sf >= 3.4.
In particular I was following this and at point 2 services managed directly by
CompilerPass
were never founded.Moreover - not related directly to this PR - I'm not sure that this "split"
getDefinition
/findDefinition
/getAlias
is really useful, but maybe I don't have the bigger picture.WDYT?
PS.: Maybe this edit could be applied not only for sf 4 but also for previous versions?