Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DependencyInjection] Doc for #30257 Allow to choose an index for tagged collection #11009

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

Merged
merged 1 commit into from
Oct 4, 2020

Conversation

XuruDragon
Copy link

Here is the doc for the new feature implemented in : symfony/symfony#30257

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.

Some more changes please 🙈 🍻

@XuruDragon
Copy link
Author

XuruDragon commented Feb 19, 2019

Some more changes please

Done, thanks @OskarStark

@XuruDragon
Copy link
Author

XuruDragon commented Mar 11, 2019

Could you please update the PR to tell about symfony/symfony#30348 also? That'd be great :)

I've added a See also at the end, like i've done for the service locator docs here : #11042

@nicolas-grekas
Copy link
Member

Please note that in symfony/symfony#31463 I'm proposing to change the fallback from FQCN to service id. This PR should be updated accordingly when mine is merged.

@nicolas-grekas
Copy link
Member

nicolas-grekas commented May 13, 2019

symfony/symfony#31463 is now merged with another behavior to document:
when a tagged_locator is used, the index-by attribute defaults to the tag name (minus any "dot" prefix):
!tagged_locator app.foo will collect a service bar with tag app.foo {foo: baz} as index baz (and fallback to the service id bar when the foo attribute is not defined.

@javiereguiluz
Copy link
Member

Closing as already merged in #11042, which was identical to this one and documented two different Symfony features (symfony/symfony#30348 and symfony/symfony#30257). Thanks.

@HypeMC
Copy link
Contributor

HypeMC commented Sep 29, 2019

@javiereguiluz I don't think #11042 covers this feature. #11042 is about service locators & the !tagged_locator tag, whereas this PR is about tagged services & !tagged tag.

Even though they are very similar, they are still two different features, each with its own dedicated page. Currently, the index_by & default_index_method options of the !tagged tag are not documented anywhere apart from the original blog post.

Perhaps you should consider reopening this PR since it covers these undocumented features?

@javiereguiluz
Copy link
Member

Let's open then. Thanks.

@javiereguiluz javiereguiluz reopened this Sep 30, 2019
@HeahDude HeahDude added this to the 4.4 milestone Feb 7, 2020

.. tip::

You can omit the ``index_attribute_name`` attribute, by implementing a static
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with Javier, the sentence should be You can omit the ``key`` attribute..., then directly show the usage of

arguments: [!tagged { tag: 'app.handler', index_by: 'key', default_index_method: 'someFunctionName' }]

within the tip, and discard the following.

@wouterj wouterj changed the base branch from master to 4.4 October 4, 2020 11:23
@wouterj wouterj force-pushed the di-tagged-itterator branch from 338058f to 980b3d3 Compare October 4, 2020 11:23
wouterj added a commit that referenced this pull request Oct 4, 2020
@wouterj wouterj merged commit 56dd405 into symfony:4.4 Oct 4, 2020
@wouterj
Copy link
Member

wouterj commented Oct 4, 2020

Thanks @XuruDragon for creating this PR! This is now merged and I've shortened the changes a bit without loosing any information afterwards in 4ffbc62 .

wouterj added a commit that referenced this pull request Oct 4, 2020
* 4.4:
  [#11009] Some tweaks
  [DependencyInjection] Doc for #30257 Allow to choose an index for tagged collection
  [#12523] Reworded caution
  Add a documentation page for lock in FW
  [Configuration] Add documentation about `ignore_errors: not_found` option.
wouterj added a commit that referenced this pull request Oct 4, 2020
* 5.1:
  [#11009] Some tweaks
  [DependencyInjection] Doc for #30257 Allow to choose an index for tagged collection
  [#12523] Reworded caution
  Add a documentation page for lock in FW
  [Configuration] Add documentation about `ignore_errors: not_found` option.
wouterj added a commit that referenced this pull request Oct 4, 2020
This PR was merged into the 4.4 branch.

Discussion
----------

[DI] replace tagged by tagged_iterator

introduce with #11009
cc @wouterj

Commits
-------

0d75a98 [DI] replace tagged by tagged_iterator
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.

10 participants