You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #21306 [DependencyInjection] Always autowire the constructor (dunglas)
This PR was merged into the 3.3-dev branch.
Discussion
----------
[DependencyInjection] Always autowire the constructor
| Q | A
| ------------- | ---
| Branch? | master
| Bug fix? | no
| New feature? | no
| BC breaks? | no (because method autowiring has been introduced in 3.3)
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | n/a
| License | MIT
| Doc PR | n/a
Always try to autowire the constructor even if it has not been configured explicitly. It doesn't make sense to autowire some methods but not the constructor. It will also allow to write shorter definitions when using method autowiring:
```yaml
services:
Foo\Bar: { autowire: ['set*'] }
```
instead of
```yaml
services:
Foo\Bar: { autowire: ['__construct', 'set*'] }
```
Commits
-------
be3d11f [DependencyInjection] Always autowire the constructor
0 commit comments