Skip to content

[DependencyInjection] Update syntax for #[AutowireLocator] and add #[AutowireIterator] #18993

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 10, 2023

Conversation

OskarStark
Copy link
Contributor

@OskarStark OskarStark commented Oct 5, 2023

@carsonbot carsonbot changed the title Show array syntax for #[AutowireLocator] [DependencyInjection] Show array syntax for #[AutowireLocator] Oct 5, 2023
@carsonbot carsonbot added this to the 6.4 milestone Oct 5, 2023
Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

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

This attribute now behaves identically to TaggedLocator - not sure we want to document this until we deprecate that attribute?

Additionally, when passing an array of services, you can use SubscribedService's in order to add other DI attributes.

@OskarStark OskarStark changed the title [DependencyInjection] Show array syntax for #[AutowireLocator] [DependencyInjection] Update syntax for #[AutowireLocator] Oct 6, 2023
@OskarStark OskarStark added the Waiting Code Merge Docs for features pending to be merged label Oct 6, 2023
@carsonbot carsonbot modified the milestones: 6.4, next Oct 6, 2023
@OskarStark
Copy link
Contributor Author

OskarStark commented Oct 6, 2023

Additionally, when passing an array of services, you can use SubscribedService's in order to add other DI attributes.

I don't get it 😄 Can you add an example or provide a PR? Thanks

@OskarStark OskarStark requested a review from kbond October 6, 2023 06:18
@OskarStark OskarStark changed the title [DependencyInjection] Update syntax for #[AutowireLocator] [DependencyInjection] Update syntax for #[AutowireLocator] and add #[AutowireIterator] Oct 6, 2023
@OskarStark
Copy link
Contributor Author

SubscribedService added

@OskarStark OskarStark removed the Waiting Code Merge Docs for features pending to be merged label Oct 6, 2023
@OskarStark OskarStark requested review from javiereguiluz and removed request for kbond October 9, 2023 07:43
@kbond
Copy link
Member

kbond commented Oct 9, 2023

I don't get it 😄 Can you add an example or provide a PR? Thanks

A bit contrived but here's an example: https://github.com/symfony/symfony/blob/3147082e35faadd873a801a4011bc8cbb79807e0/src/Symfony/Component/DependencyInjection/Tests/Fixtures/AutowireLocatorConsumer.php#L26

@OskarStark OskarStark force-pushed the autowire-locator-optional-dep branch from 06ec120 to d173ca7 Compare October 10, 2023 12:06
@OskarStark
Copy link
Contributor Author

Ready to merge from my side

@OskarStark OskarStark modified the milestones: next, 6.4 Oct 10, 2023
@OskarStark OskarStark requested a review from kbond October 10, 2023 13:29
@OskarStark OskarStark force-pushed the autowire-locator-optional-dep branch from 4dbc867 to 528cbda Compare October 10, 2023 14:03
@OskarStark OskarStark merged commit 4918230 into symfony:6.4 Oct 10, 2023
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] Add #[AutowireIterator] attribute and improve `…
3 participants