|
1 | 1 | ## SOLID Principles Examples in PHP |
2 | 2 |
|
3 | | -### Single Responsibility Principle |
4 | | -A class should have one, and only one, reason to change. [Example](./1-single-responsibility-principle.php) |
| 3 | +### Single Responsibility Principle ([Example](./1-single-responsibility-principle.php)) |
| 4 | +This principle is about **actors and high level architecture**. |
| 5 | +> A class should have one, and only one, reason to change. |
5 | 6 |
|
6 | | -### Open Closed Principle |
7 | | -A class should be open for extension, but closed for modification. [Example](./2-open-closed-principle.php) |
| 7 | +### Open Closed Principle ([Example](./2-open-closed-principle.php)) |
| 8 | +This principle is about **class design and feature extensions**. |
| 9 | +> A class should be open for extension, but closed for modification. |
8 | 10 |
|
9 | | -### Liskov Substitution Principle |
10 | | -Derived classes must be substitutable for their base classes. [Example](./3-liskov-substitution-principle.php) |
| 11 | +### Liskov Substitution Principle ([Example](./3-liskov-substitution-principle.php)) |
| 12 | +This principle is about **subtyping and inheritance** |
| 13 | +> Derived classes must be substitutable for their base classes. |
11 | 14 |
|
12 | | -### Interface Segregation Principle |
13 | | -Many client-specific interfaces are better than one general-purpose interface. [Example](./4-interface-segregation-principle.php) |
| 15 | +### Interface Segregation Principle ([Example](./4-interface-segregation-principle.php)) |
| 16 | +This principle is about **business logic to clients communication**. |
| 17 | +> Many client-specific interfaces are better than one general-purpose interface. |
14 | 18 |
|
15 | | -### Dependency Inversion Principle |
16 | | -Depend upon abstractions. Do not depend upon concretions. [Example](./5-dependency-inversion-principle.php) |
| 19 | +### Dependency Inversion Principle ([Example](./5-dependency-inversion-principle.php)) |
| 20 | +> This principle wires up all **other four principles in a single circle**. |
| 21 | +Depend upon abstractions. Do not depend upon concretions. |
17 | 22 |
|
18 | 23 | #### For more information about *Object Oriented Design Principles*, you can refer [this slide](https://viblo.asia/thangtd90/posts/pVYRPJPmG4ng) |
0 commit comments