What does dependency injection do in PHP?

Possible duplicate:
What is dependency injection?

What is the run around "dependency injection" adapted from Java and introduced in Symfony 2? Can someone give an example of a problem and solution with and without dependency injection?

+3
source share
1 answer

An explanation that is suitable for PHP: http://fabien.potencier.org/article/11/what-is-dependency-injection

BTW: This is not only a Java world. DI and DIC variations are used in most high-level programming languages. This is a universal practice that helps you write more convenient code.

+2
source

Source: https://habr.com/ru/post/1796648/


All Articles