69dcf41a3c
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
-------
|
||
---|---|---|
.. | ||
extension1 | ||
extension2 | ||
extensions | ||
legacy_invalid_alias_definition.xml | ||
namespaces.xml | ||
nonvalid.xml | ||
services1.xml | ||
services2.xml | ||
services3.xml | ||
services4_bad_import.xml | ||
services4.xml | ||
services5.xml | ||
services6.xml | ||
services7.xml | ||
services8.xml | ||
services9.xml | ||
services10.xml | ||
services13.xml | ||
services14.xml | ||
services21.xml | ||
services22.xml | ||
services23.xml | ||
services24.xml | ||
services27.xml | ||
services28.xml | ||
services_deprecated.xml | ||
tag_with_empty_name.xml | ||
tag_without_name.xml | ||
with_key_outside_collection.xml | ||
withdoctype.xml |