8000 [DependencyInjection] Add docs for default priority method for tagged services by alexandrunastase · Pull Request #12697 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[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

Conversation

alexandrunastase
Copy link
Contributor

Fixes #12406

@alexandrunastase alexandrunastase changed the title [WIP] [DependencyInjection] Add method priority for tagged services [WIP] [DependencyInjection] Add docs for method priority for tagged services Nov 26, 2019
@alexandrunastase alexandrunastase force-pushed the add-method-priority-for-tagged-services branch 2 times, most recently from ae734d0 to 00fda26 Compare November 26, 2019 07:45
Copy link
Contributor
@OskarStark OskarStark left a 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 👍

@alexandrunastase alexandrunastase force-pushed the add-method-priority-for-tagged-services branch 2 times, most recently from 217e1ac to 2b5bcd4 Compare December 1, 2019 19:46
@alexandrunastase alexandrunastase marked this pull request as ready for review December 1, 2019 19:48
@alexandrunastase alexandrunastase changed the title [WIP] [DependencyInjection] Add docs for method priority for tagged services [DependencyInjection] Add docs for method priority for tagged services Dec 1, 2019
@alexandrunastase alexandrunastase changed the title [DependencyInjection] Add docs for method priority for tagged services [DependencyInjection] Add docs for default method priority for tagged services Dec 1, 2019
@alexandrunastase alexandrunastase changed the title [DependencyInjection] Add docs for default method priority for tagged services [DependencyInjection] Add docs for default priority method for tagged services Dec 1, 2019
@@ -570,47 +570,113 @@ application handlers::
}
}

.. tip::
Prioritizing Tagged Services
Copy link
Contributor

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?

cc @javiereguiluz

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

8000
Prioritizing Tagged Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The tagged services can be prioritized using the ``priority`` attribute:
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor

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:

Copy link
Contributor Author

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

Copy link
Contributor
@HeahDude HeahDude left a 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

Prioritizing Tagged Services
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The tagged services can be prioritized using the ``priority`` attribute:
Copy link
Contributor

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it. Thanks :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a dot :)

Copy link
Contributor Author
@alexandrunastase alexandrunastase Jun 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added it :)

@HeahDude HeahDude modified the milestones: 4.3, 4.4 Feb 19, 2020
@alexandrunastase alexandrunastase force-pushed the add-method-priority-for-tagged-services branch from 2b5bcd4 to b2fd0f1 Compare March 22, 2020 09:11
@alexandrunastase alexandrunastase force-pushed the add-method-priority-for-tagged-services branch 3 times, most recently from a21981b to d5b8517 Compare March 22, 2020 09:21
Copy link
Contributor
@HeahDude HeahDude left a 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

Copy link
Contributor
@HeahDude HeahDude left a 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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a dot :)

->args([
tagged_iterator('app.handler', null, null, 'getPriority'),
]
);
Copy link
Contributor

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

Copy link
Contributor Author
@alexandrunastase alexandrunastase Jun 8, 2020

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.

@alexandrunastase alexandrunastase force-pushed the add-method-priority-for-tagged-services branch from f5da791 to 4c99d1f Compare June 8, 2020 06:37
@wouterj wouterj force-pushed the add-method-priority-for-tagged-services branch from 4c99d1f to 294ac51 Compare October 3, 2020 21:15
wouterj added a commit that referenced this pull request Oct 3, 2020
@wouterj wouterj merged commit b7a35f2 into symfony:4.4 Oct 3, 2020
@wouterj
Copy link
Member
wouterj commented Oct 3, 2020

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!

wouterj added a commit that referenced this pull request Oct 3, 2020
* 4.4:
  [#12697] Some minor tweaks
  [DependencyInjection] Add docs for default priority method for tagged services
  [#12461] Added versionadded directive
  List CSV encoder's context options
wouterj added a commit that referenced this pull request Oct 3, 2020
* 5.1:
  Removed versionadded 4.4 directives
  [#12697] Some minor tweaks
  [DependencyInjection] Add docs for default priority method for tagged services
  [#12461] Added versionadded directive
  List CSV encoder's context options
@alexandrunastase
Copy link
Contributor Author

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DependencyInjection] added Ability to define a priority method for tag…
6 participants
0