- Issue created by @larowlan
Symfony supports auto-wiring of controller methods. For example:
class SomeController {
public function someMethod(ConfigFactoryInterface $configFactory) {
// Here $configFactory is autowired/injected from the container.
}
}
Because we have our own version of controller resolver, we're missing the upstream changes that support this.
This simplifies controllers as they no longer need as much boiler-plate for constructor injection.
It also allows more granular dependency injection for controller classes with multiple methods. If a dependency is only needed for one method, there is no need to inject that service into the constructor. Constructor injection can be reserved for services that span multiple methods. This will then result in leaner and easier to maintain code and an improved DX.
Add support for auto-wiring of controller methods via arguments by mirroring the updated logic from upstream.
Active
11.0 π₯
Enhances developer experience.