SOLID principles

PHP: Dependency inversion principle

PHP: Dependency inversion principle

Definition Dependency Inversion Principle (DIP), is one of the SOLID principles of object-oriented design. The Dependency Inversion Principle states that high-level modules (classes) should not depend on low-level modules; both should depend on abstractions. Additionally, abstractions should not depend on details; details should depend on abstractions. This principle encourages the use of interfaces or abstract…