The SOLID principles demonstrated in PHP as seen on Elaniin's SOLID Booster Session.

Overview

SOLID Principles

tests

SOLID is the mnemonic acronym that represents 5 design principles that aim to make software designs more understandable, flexible, and sustainable.

In this repository, you will find a folder under src/ for each principle and each principle has two folders: one for the stable version and one for the unstable version.

The Stable folder contains one of the possible ways to apply the principle to the given use case. The Unstable folder contains an example of how the same use case would be without applying the principle.

💿 Installation

Install the dependencies:

composer install --prefer-dist

🙋🏻 Usage

Run the classes by specifying the principle name (either in snake_case or kebab-case) and optionally the stable/unstable flag.

composer class [principle-name] [stable|unstable]

Example:

composer class single-responsibility stable

🤓 Content

Single Responsibility

Each entity (module, class, or function) should have a single responsibility for a part of a feature in a system, and this responsibility should be encapsulated. In other words, each module should be responsible for a single thing or have only one reason to change.

Open-Closed

Each entity should be closed for modification but open for extension.

Liskov Substitution

If B is a subtype of A, then objects of type A should be exchangeable by objects of type B without affecting the desired result.

Interface Segregation

A client should not be forced to depend on methods it does not use.

Dependency Inversion

High-level modules should not import anything from low-level modules. Both should depend on abstractions.

Material

Agile Software Development: Principles, Patterns, and Practices: https://www.amazon.com/Software-Development-Principles-Patterns-Practices/dp/0135974445

Clean Architecture: A Craftsman's Guide to Software Structure and Design: https://www.amazon.com/Clean-Architecture-Craftsmans-Software-Structure/dp/0134494164

📃 License

This is an open-source project licensed under the MIT license.

You might also like...
A Redis-based session handler for Magento with optimistic locking.

Cm_RedisSession A Redis-based session handler for Magento with optimistic locking. Features: Falls back to mysql handler if it can't connect to Redis.

The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3
The Current US Version of PHP-Nuke Evolution Xtreme v3.0.1b-beta often known as Nuke-Evolution Xtreme. This is a hardened version of PHP-Nuke and is secure and safe. We are currently porting Xtreme over to PHP 8.0.3

2021 Nightly Builds Repository PHP-Nuke Evolution Xtreme Developers TheGhost - Ernest Allen Buffington (Lead Developer) SeaBeast08 - Sebastian Scott B

A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

PHP Meminfo is a PHP extension that gives you insights on the PHP memory content

MEMINFO PHP Meminfo is a PHP extension that gives you insights on the PHP memory content. Its main goal is to help you understand memory leaks: by loo

A sampling profiler for PHP written in PHP, which reads information about running PHP VM from outside of the process.

Reli Reli is a sampling profiler (or a VM state inspector) written in PHP. It can read information about running PHP script from outside of the proces

A multithreaded application server for PHP, written in PHP.

appserver.io, a PHP application server This is the main repository for the appserver.io project. What is appserver.io appserver.io is a multithreaded

Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP

Lodash-PHP Lodash-PHP is a port of the Lodash JS library to PHP. It is a set of easy to use utility functions for everyday PHP projects. Lodash-PHP tr

A PHP 5.3+ and PHP 7.3 framework for OpenGraph Protocol

Opengraph Test with Atoum cd Opengraph/ curl -s https://getcomposer.org/installer | php php composer.phar install --dev ./vendor/atoum/atoum/bin/atoum

A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch screens with a resolution of 1024x600 connected to a Raspberry Pi.

EDStatusPanel A status monitor for Elite Dangerous, written in PHP. Designed for 1080p screens in the four-panel-view in panel.php, and for 7 inch scr

Owner
Vlass Contreras
PHP Zend Certified Engineer.
Vlass Contreras
YCOM Impersonate. Login as selected YCOM user 🧙‍♂️in frontend.

YCOM Impersonate Login as selected YCOM user in frontend. Features: Backend users with admin rights or YCOM[] rights, can be automatically logged in v

Friends Of REDAXO 17 Sep 12, 2022
A plugin to make Nextcloud compatible with Solid

solid-nextcloud A plugin to make Nextcloud compatible with Solid.

PDS Interop 54 Jan 2, 2023
Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC from scratch

This Project is based on course CSC 3215. Learning about - Basic HTML & CSS, JSON, XML, Session & Cookies, CRUD Operations in Php using MySQL and Create MVC (Model–View–Controller) from scratch. Just learning about web technologies, Not focusing on UI (Bootstrap or other 3rd-Party UI libraries or frameworks).

Alvi Hasan 5 Sep 21, 2022
Block Session Hijacking in php.

Block Session Hijacking in php. How Does it work? This is an incredibly simple example, that is meant to be worked on. Please Do NOT use this from sto

null 0 Dec 25, 2021
A Redis-backed PHP session handler with optimistic locking

php-redis-session-abstract A Redis-based session handler with optimistic locking. Features: When a session's data size exceeds the compression thresho

Colin Mollenhour 59 Dec 16, 2022
A Simple MVC PHP Framework, integrated with lot of features such as Session, Cookies, Migrations, Database, Factories, Seeding, Bootstrap and Tailwind CSS

Navite A Simple MVC PHP Framework, integrated with lot of features such as Session, Cookies, Migrations, Database, Factories, Seeding, Bootstrap and T

Celionatti 2 Aug 22, 2022
Web app for kick session in a server 1C use rac/ras

Server requirement OS: Ubuntu 20.04 Usage Update adm1c nano adm1c You should change server_name adm1c.example.com to your name Update index.php nano

null 10 Dec 5, 2022
This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

This Magento extension provides a Real Full Page Caching (FPC) for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes

Hugues Alary 95 Feb 11, 2022
AWS DynamoDB session handler for Magento (experimental!)

Magento Session Handler for AWS DynamoDB Author: Fabrizio Branca TODO: disable automatic gc create cron that does gc how does it keep track of lifetim

AOE 5 Apr 6, 2017
Redis-based session handler for Magento with optimistic locking

Cm_RedisSession A Redis-based session handler for Magento with optimistic locking. Features: Falls back to mysql handler if it can't connect to Redis.

Colin Mollenhour 216 Jan 5, 2023