This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/DependencyInjection/Tests
Fabien Potencier 69dcf41a3c feature #20167 [DependencyInjection] Make method (setter) autowiring configurable (dunglas)
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
-------

6dd53c7 [DependencyInjection] Introduce method injection for autowiring
2016-12-13 16:48:43 +01:00
..
Compiler feature #20167 [DependencyInjection] Make method (setter) autowiring configurable (dunglas) 2016-12-13 16:48:43 +01:00
Config [DI] Only rebuild autowiring cache when actually needed 2016-04-03 09:35:21 +02:00
Dumper Merge branch '3.1' into 3.2 2016-12-08 16:18:22 +01:00
Extension fixed CS 2014-09-22 10:32:35 +02:00
Fixtures feature #20167 [DependencyInjection] Make method (setter) autowiring configurable (dunglas) 2016-12-13 16:48:43 +01:00
LazyProxy removed all @covers annotations 2015-11-01 14:17:24 -08:00
Loader feature #20167 [DependencyInjection] Make method (setter) autowiring configurable (dunglas) 2016-12-13 16:48:43 +01:00
ParameterBag [DI] Allow null as default env value 2016-11-23 14:12:24 +01:00
ChildDefinitionTest.php replace DefinitionDecorator with ChildDefinition 2016-12-13 12:26:14 +01:00
ContainerBuilderTest.php replace DefinitionDecorator with ChildDefinition 2016-12-13 12:26:14 +01:00
ContainerTest.php [PhpUnitBridge] Drop ErrorAssert in favor of @expectedDeprecation 2016-10-21 22:33:10 +02:00
CrossCheckTest.php Fix PHP 7.1 related failures 2016-07-19 10:44:18 +02:00
DefinitionDecoratorTest.php replace DefinitionDecorator with ChildDefinition 2016-12-13 12:26:14 +01:00
DefinitionTest.php [DependencyInjection] Introduce method injection for autowiring 2016-12-02 09:49:57 +01:00
ParameterTest.php removed all @covers annotations 2015-11-01 14:17:24 -08:00
ReferenceTest.php removed all @covers annotations 2015-11-01 14:17:24 -08:00