Skip to content

[DependencyInjection] autowire union and intersection types #43479

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 13, 2021

Conversation

nicolas-grekas
Copy link
Member

@nicolas-grekas nicolas-grekas commented Oct 13, 2021

Q A
Branch? 5.4
Bug fix? no
New feature? yes
Deprecations? no
Tickets #43325
License MIT
Doc PR -

This PR allows autowiring an argument of type NormalizerInterface&DenormalizerInterface if both individual types have a corresponding autowiring alias, and if both aliases point to the very same service.

This works the same with union types.

@derrabus
Copy link
Member

Thank you Nicolas.

@derrabus derrabus merged commit 21528c6 into symfony:5.4 Oct 13, 2021
@nicolas-grekas nicolas-grekas deleted the di-intersect-autow branch October 14, 2021 06:13
This was referenced Nov 5, 2021
nicolas-grekas added a commit that referenced this pull request Nov 6, 2021
… together with `ServiceSubscriberInterface` (kbond)

This PR was squashed before being merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] Fix support for unions/intersections together with `ServiceSubscriberInterface`

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | -
| License       | MIT
| Doc PR        | -

Continuation of #43479 per [discussion](#43913 (comment)) with `@nicolas`-grekas.

Todo:
- [x] intersection type support/tests
- [x] `ServiceSubscriberTrait` support

Commits
-------

123842a [DependencyInjection] Fix support for unions/intersections together with `ServiceSubscriberInterface`
xabbuh added a commit that referenced this pull request Jul 20, 2022
…message (xabbuh)

This PR was merged into the 5.4 branch.

Discussion
----------

[DependencyInjection] fix expected autowiring exception message

| Q             | A
| ------------- | ---
| Branch?       | 5.4
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Tickets       |
| License       | MIT
| Doc PR        |

types are sorted since #43479 in 5.4+

Commits
-------

1373257 fix expected autowiring exception message
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.

6 participants