SOLID Principles coded in PHP scripting language.
- Single responsibility
- a class or a module should have only a single responsibility
- there should be only one reason to change a class or module
- Open/closed
- classes, functions, modules should be open for extension, but closed for modification
- Liskov substitution
- when extending a class, remember that you should be able to pass objects of the subclass in place of objects of the parent class without breaking the client code
- Interface segregation
- classes that implement interfaces should not be forced to implement methods they do not use
- it is better to have many small interfaces, rather than a few large interfaces
- Dependency inversion
- high level objects should not depend on low level implementations. Both should depend on abstractions.
- abstractions should not depend on details. Details should depend on abstractions.