Subscribe to PHP Freaks RSS

Avoiding Setter Injection

syndicated from planet-php.net on 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.