This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Make method (setter) autowiring configurable
| Q | A |
| --- | --- |
| Branch? | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | maybe? |
| Tests pass? | yes |
| Fixed tickets | #19631 |
| License | MIT |
| Doc PR | symfony/symfony-docs#7041 |
Follow up of #19631. Implements https://github.com/symfony/symfony/pull/19631#issuecomment-240646169:
Edit: the last supported format:
``` yaml
services:
foo:
class: Foo
autowire: ['__construct', 'set*'] # Autowire constructor and all setters
autowire: true # Converted by loaders in `autowire: ['__construct']` for BC
autowire: ['foo', 'bar'] # Autowire only `foo` and `bar` methods
```
Outdated:
``` yaml
autowire: true # constructor autowiring
autowire: [__construct, setFoo, setBar] # autowire whitelisted methods only
autowire: '*' # autowire constructor + every setters (following existing rules for setters autowiring)
```
- [x] Allow to specify the list of methods in the XML loader
- [x] Add tests for the YAML loader
Commits
-------
|
||
---|---|---|
.. | ||
Bridge | ||
Bundle | ||
Component |