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

Skip to content

[FrameworkBundle] debug:container --tag x doesn't show priority defined with AsTaggedItem #48532

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

Closed
kbond opened this issue Dec 7, 2022 · 2 comments

Comments

@kbond
Copy link
Member

kbond commented Dec 7, 2022

Symfony version(s) affected

5.4+

Description

If a service uses AsTaggedItem to set the priority, this priority isn't displayed when running debug:container --tag x.

How to reproduce

#47406 (comment)

Possible Solution

No response

Additional Context

No response

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Dec 14, 2022

Same as in #47406 (review):

AsTaggedItem is supposed to work together with TaggedIteratorArgument. That's what the word "Tagged" means in the name of the attribute. When not requesting for "tagged" items, the returned array should be a regular list.

#[AutoconfigureTag('some_tag', ['priority' => 10])] is what you might want to add to set the priority for this tag.

If we were to implement something like you expected, I'd suggest doing it via a tag, eg
['default_attributes', ['priority' => 10]], and we could of course add a dedicated attribute to make it easier to define this tag.

Or maybe ['default_attributes', ['some_tag' => ['priority' => 10]]] for more specificity?

Or something else? I'm just thinking loud here :)

@kbond
Copy link
Member Author

kbond commented Dec 14, 2022

#[AutoconfigureTag('some_tag', ['priority' => 10])]

This works just fine for me.

I'm still not quite understanding when/why I would use AsTaggedItem over this though. Most of these attributes aren't documented so that could probably be the place to explain.

@kbond kbond closed this as completed Dec 14, 2022
@kbond kbond closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants