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

Skip to content

[HttpKernel] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments #49500

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

HypeMC
Copy link
Contributor

@HypeMC HypeMC commented Feb 22, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? no
Deprecations? no
Tickets Fix #49083
License MIT
Doc PR -

I think this doesn't qualify as a bug fix, but an improvement. If I'm wrong please let me know.

#49628 fixed the issue, this PR only adds tests now.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Thanks.
Can you please let me know if #[Autowire(new TaggedLocator(...))] (or #[Autowire(new ServiceLocatorArgument())] I don't remember) works?

@HypeMC HypeMC force-pushed the taggediterator-and-taggedlocator-as-controller-argument branch from 187fa79 to 09f38cf Compare February 22, 2023 19:33
@HypeMC
Copy link
Contributor Author

HypeMC commented Feb 22, 2023

Thanks. Can you please let me know if #[Autowire(new TaggedLocator(...))] (or #[Autowire(new ServiceLocatorArgument())] I don't remember) works?

@nicolas-grekas No, neither work. As far as I can tell, the #[Autowire] attribute is not designed to work like that.

@HypeMC
Copy link
Contributor Author

HypeMC commented Feb 22, 2023

Funny thing, this does seem to work:

#[Autowire([new ServiceLocatorArgument(new TaggedIteratorArgument(...)), new TaggedIteratorArgument(...)])]

In this case, the argument is an array with a service locator and an iterator.

@HypeMC HypeMC force-pushed the taggediterator-and-taggedlocator-as-controller-argument branch from 09f38cf to 226cb98 Compare February 23, 2023 09:15
@nicolas-grekas
Copy link
Member

Can you please try #49628? It might have fixed the issue. If not, the PR will still need to be updated to account for the changes in #49628.

@HypeMC HypeMC force-pushed the taggediterator-and-taggedlocator-as-controller-argument branch from 226cb98 to 8900199 Compare March 9, 2023 22:14
@HypeMC HypeMC changed the title [DependencyInjection][HttpKernel] Add support for #[TaggedIterator] & #[TaggedLocator] with controller arguments [DependencyInjection] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments Mar 9, 2023
@HypeMC
Copy link
Contributor Author

HypeMC commented Mar 9, 2023

Can you please try #49628? It might have fixed the issue. If not, the PR will still need to be updated to account for the changes in #49628.

@nicolas-grekas Yep, #49628 fixed the problem. I've removed all my changes except the test cases as this particular functionality isn't covered anywhere.

@HypeMC HypeMC force-pushed the taggediterator-and-taggedlocator-as-controller-argument branch from 8900199 to 121e072 Compare March 9, 2023 22:26
@carsonbot carsonbot changed the title [DependencyInjection] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments [DependencyInjection][HttpKernel] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments Mar 10, 2023
@carsonbot carsonbot changed the title [DependencyInjection][HttpKernel] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments [HttpKernel] Add tests for #[TaggedIterator] & #[TaggedLocator] on controller arguments Mar 10, 2023
@nicolas-grekas
Copy link
Member

Thank you @HypeMC.

@nicolas-grekas nicolas-grekas merged commit 844df3e into symfony:6.3 Mar 10, 2023
@HypeMC HypeMC deleted the taggediterator-and-taggedlocator-as-controller-argument branch March 10, 2023 10:55
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.

TaggedLocator/TaggedIterator attributes does not work in controller argument
3 participants