Repository of PHP architect training that I participated in solid principles with the company Alura.
PHP
SOLID-PHP
Single responsibility principle (SPR)
It's about reducing class coupling by splitting and giving each class just one function.
Each software module should have one and only one reason to change. Uncle Bob
Open/closed principle (OCP)
We must ensure that each action or responsibility is in the correct class through interfaces, access modifiers and getters/setters we can achieve this goal.
Software entities (classes, modules, functions, etc.) must be open for extension but closed for modification. Bertrand Meyer
Liskov substitution principle (LSP)
Attest to which method is being subtyped/ extended, so that there are no implementation conflicts.
liskov's substitution principle, a base class must be able to be replaced by its child classes anywhere in the code
The interface segregation principle: (ISP)
Clients should not be forced to depend upon interfaces that they do not use.