Avoiding Setter Injection

Written by Brandon Savage - - Aggregated on Thursday October 11, 2018

PHP more or less has two kinds of dependency injection available: constructor injection, and setter injection. Constructor injection is the process of injecting dependencies through the constructor arguments, like so: The dependencies are injected via the constructor, on object creation, and the object has them from the very beginning. Setter injection is different; instead of […]

The post Avoiding Setter Injection appeared first on BrandonSavage.net.


« Symfony Loves PHP conference 2018 … - Symfony blog

Evert Pot - Ketting 2.3 release »