Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wataridori/solid-php-example
Some examples about SOLID Design Principles in PHP
https://github.com/wataridori/solid-php-example
php principles solid
Last synced: 3 months ago
JSON representation
Some examples about SOLID Design Principles in PHP
- Host: GitHub
- URL: https://github.com/wataridori/solid-php-example
- Owner: wataridori
- License: mit
- Created: 2016-04-19T03:25:07.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-10-30T11:19:42.000Z (over 2 years ago)
- Last Synced: 2024-08-02T05:11:38.213Z (6 months ago)
- Topics: php, principles, solid
- Language: PHP
- Size: 6.84 KB
- Stars: 457
- Watchers: 21
- Forks: 133
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
## SOLID Principles Examples in PHP
### Single Responsibility Principle ([Example](./1-single-responsibility-principle.php))
This principle is about **actors and high level architecture**.
> A class should have one, and only one, reason to change.### Open Closed Principle ([Example](./2-open-closed-principle.php))
This principle is about **class design and feature extensions**.
> A class should be open for extension, but closed for modification.### Liskov Substitution Principle ([Example](./3-liskov-substitution-principle.php))
This principle is about **subtyping and inheritance**
> Derived classes must be substitutable for their base classes.### Interface Segregation Principle ([Example](./4-interface-segregation-principle.php))
This principle is about **business logic to clients communication**.
> Many client-specific interfaces are better than one general-purpose interface.### Dependency Inversion Principle ([Example](./5-dependency-inversion-principle.php))
This principle wires up all **other four principles in a single circle**.
> Depend upon abstractions. Do not depend upon concretions.#### For more information about *Object Oriented Design Principles*, you can refer [this slide](https://viblo.asia/thangtd90/posts/pVYRPJPmG4ng)