co-stack / dependency-injection-additions
Awesome additions for symfony/dependency-injection
Package info
gitlab.com/co-stack.com/co-stack.com/php-packages/dependency-injection-additions
pkg:composer/co-stack/dependency-injection-additions
Requires
- php: ^8.2
- symfony/dependency-injection: ^v7.0 || ^v8.0
README
About
This package contains awesome, ready-to-use, out-of-the-box, features built on top of symfony/dependency-injection. These features extend the default feature set of the DI container.
Features
InjectionAware
Implement the interface \CoStack\DependencyInjectionAdditions\InjectionAware\InjectionAware. The method __injected
will be called automatically after all dependencies were injected.
When using __construct to initialize an object, only constructor injections are available. With __injected, all
dependencies were injected (constructor, property, method) and are available.
This effectively allows ditching the constructor injection.