mirror of
https://github.com/wataridori/solid-php-example.git
synced 2024-12-12 14:17:54 +00:00
Some examples about SOLID Design Principles in PHP
cc801b80f8
Add canCode() to Workable |
||
---|---|---|
.gitignore | ||
1-single-responsibility-principle.php | ||
2-open-closed-principle.php | ||
3-liskov-substitution-principle.php | ||
4-interface-segregation-principle.php | ||
5-dependency-inversion-principle.php | ||
readme.md |
SOLID Principles Examples in PHP
Single Responsibility Principle
A class should have one, and only one, reason to change. Example
Open Closed Principle
A class should be open for extension, but closed for modification. Example
Liskov Substitution Principle
Derived classes must be substitutable for their base classes. Example
Interface Segregation Principle
Many client-specific interfaces are better than one general-purpose interface. Example
Dependency Inversion Principle
Depend upon abstractions. Do not depend upon concretions. Example