-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[DependencyInjection] Add docs for default priority method for tagged services #12697
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
[DependencyInjection] Add docs for default priority method for tagged services #12697
Conversation
ae734d0
to
00fda26
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.
Thank you for working on this 👍
217e1ac
to
2b5bcd4
Compare
service_container/tags.rst
Outdated
@@ -570,47 +570,113 @@ application handlers:: | |||
} | |||
} | |||
|
|||
.. tip:: | |||
Prioritizing Tagged Services |
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.
Maybe „Tagged Services with Priority“ sounds more natural?
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.
For me the current one sounds a bit clearer, but if others think that "Tagged Services with Priority" is better I will just update it.
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.
Changed it to how you suggested
service_container/tags.rst
Outdated
Prioritizing Tagged Services | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The tagged services can be prioritized using the ``priority`` attribute: |
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.
To me a sentence is missing what I can achieve by using priority. I mean we are talking a lot about the how but not the why. A real world use case would be very helpful to get context. Thanks
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.
From my side it looks pretty obvious, but maybe I am not the best person to ask since I did not need this until now. I started looking into this on Symfony Hack Day. If you can share some use case, we can surely added it.
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.
What about expanding that sentence a little? Something like:
The tagged services can be prioritized using the ``priority`` attribute,
so a consumer can be injected a sorted collection:
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.
Updated. I tried to avoid using the word consumer
since that can have different meanings and might confuse people. Thanks @HeahDude
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.
Looks good, thanks! Some minor comments
service_container/tags.rst
Outdated
Prioritizing Tagged Services | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The tagged services can be prioritized using the ``priority`` attribute: |
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.
What about expanding that sentence a little? Something like:
The tagged services can be prioritized using the ``priority`` attribute,
so a consumer can be injected a sorted collection:
.. tip:: | ||
Prioritizing Tagged Services | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
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.
We need a .. versionadded:: 4.4
here, see https://symfony.com/doc/current/contributing/documentation/format.html#new-features-behavior-changes-or-deprecations.
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.
Added it. Thanks :)
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.
Missing a dot :)
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.
Added it :)
2b5bcd4
to
b2fd0f1
Compare
a21981b
to
d5b8517
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.
One last change here and we should be good. Thanks
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.
Thanks for documenting this. I've spotted 2 typos on my last review, but we can handle them on merge ✌️.
.. tip:: | ||
Prioritizing Tagged Services | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
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.
Missing a dot :)
service_container/tags.rst
Outdated
->args([ | ||
tagged_iterator('app.handler', null, null, 'getPriority'), | ||
] | ||
); |
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.
Semi colon on next line
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.
Fixed the semicolon. Not sure about the dot. Assumed it was at the end of the versionadded sentence.
f5da791
to
4c99d1f
Compare
4c99d1f
to
294ac51
Compare
I'm sorry that this PR has been open for soo long @alexandrunastase. At least, it's merged now. I've done some very minor tweaks afterwards in 8a7d32e . Thanks for adding the documentation! |
Super nice! Thanks for the effort 👍 |
Fixes #12406