Skip to content

[DependencyInjection] Allow binding iterable and tagged services #33623

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
Sep 18, 2019

Conversation

lyrixx
Copy link
Member

@lyrixx lyrixx commented Sep 18, 2019

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

This will allow:

services:
    _defaults:
        bind:
            iterable $rules: !tagged_iterator app.foo.rule
    _instanceof:
        App\Foo\Rule\RuleInterface:
            tags: ['app.foo.rule']

@nicolas-grekas
Copy link
Member

Could you please add a test case?

@lyrixx
Copy link
Member Author

lyrixx commented Sep 18, 2019

I added some tests.

@nicolas-grekas
Copy link
Member

Thank you @lyrixx.

nicolas-grekas added a commit that referenced this pull request Sep 18, 2019
…d services (lyrixx)

This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Allow binding iterable and tagged services

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

This will allow:
```yaml
services:
    _defaults:
        bind:
            iterable $rules: !tagged_iterator app.foo.rule
    _instanceof:
        App\Foo\Rule\RuleInterface:
            tags: ['app.foo.rule']
```

Commits
-------

2055a55 [DependencyInjection] Allow binding iterable and tagged services
@nicolas-grekas nicolas-grekas merged commit 2055a55 into symfony:4.4 Sep 18, 2019
@lyrixx lyrixx deleted the dic-bind-iter branch September 18, 2019 11:40
@nicolas-grekas nicolas-grekas modified the milestones: next, 4.4 Oct 27, 2019
This was referenced Nov 12, 2019
nicolas-grekas added a commit that referenced this pull request Dec 19, 2019
…iners (nicolas-grekas)

This PR was merged into the 4.4 branch.

Discussion
----------

[DependencyInjection] Fix binding tagged services to containers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #34913
| License       | MIT
| Doc PR        | -

We missed this part in #33623

Commits
-------

9d48ba4 [DependencyInjection] Fix binding tagged services to containers
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.

3 participants