All Projects → gabrielanhaia → php-design-patterns

gabrielanhaia / php-design-patterns

Licence: MIT License
Learn how to implement the most important Design Patterns into your PHP application. This project uses PHP 8.1. it has examples for each Pattern and an Article explaining how to use them step by step, their advantages, and disadvantages.

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to php-design-patterns

Designpatternsphp
sample code for several design patterns in PHP 8
Stars: ✭ 20,158 (+13249.67%)
Mutual labels:  design-patterns, php8
OOP-Design-Patterns
MET CS665 - OOP Design Patterns Code Examples
Stars: ✭ 74 (-50.99%)
Mutual labels:  design-patterns
ResidenceCMS
Open Source Property Management System based on Symfony 6
Stars: ✭ 75 (-50.33%)
Mutual labels:  php8
php-json-schema-model-generator
Creates (immutable) PHP model classes from JSON-Schema files including all validation rules as PHP code
Stars: ✭ 36 (-76.16%)
Mutual labels:  php8
validation
Aplus Framework Validation Library
Stars: ✭ 99 (-34.44%)
Mutual labels:  php8
cli
Aplus Framework CLI Library
Stars: ✭ 104 (-31.13%)
Mutual labels:  php8
database
Aplus Framework Database Library
Stars: ✭ 147 (-2.65%)
Mutual labels:  php8
design-patterns-php7
Design Patterns com PHP 7: Desenvolva com as melhores soluções. Repositório com os exemplos de código do livro. Repository with the code examples in the book.
Stars: ✭ 51 (-66.23%)
Mutual labels:  design-patterns
sherpa 41
Simple browser engine.
Stars: ✭ 31 (-79.47%)
Mutual labels:  design-patterns
objproxies
Proxies and wrappers for ordinary Python objects
Stars: ✭ 18 (-88.08%)
Mutual labels:  design-patterns
engine
A pragmatic approach to templating for PHP 7.x+
Stars: ✭ 31 (-79.47%)
Mutual labels:  php8
clean-ts-api
API em NodeJs usando Typescript, TDD, Clean Architecture, Design Patterns e SOLID principles
Stars: ✭ 43 (-71.52%)
Mutual labels:  design-patterns
Design-Patterns
A collection of popular design patterns with video and text explanations
Stars: ✭ 159 (+5.3%)
Mutual labels:  design-patterns
php-mime-detector
Detect a file's mime type using magic numbers.
Stars: ✭ 20 (-86.75%)
Mutual labels:  php8
WCMP
WCMP是基于Windows x64平台下的Caddy2 + PHP + MySQL便携软件包。
Stars: ✭ 17 (-88.74%)
Mutual labels:  php8
oas
ระบบบัญชีออนไลน์ Online Accounting System (OAS)
Stars: ✭ 51 (-66.23%)
Mutual labels:  php8
angular-atomic-app
Angular 5 app built on atomic web design principles
Stars: ✭ 12 (-92.05%)
Mutual labels:  design-patterns
spark-design-system
Spark Design System
Stars: ✭ 101 (-33.11%)
Mutual labels:  design-patterns
here-we-go
Contains hundreds of samples for learning Go.
Stars: ✭ 93 (-38.41%)
Mutual labels:  design-patterns
vala
design-patterns-for-humans in Vala (programming language)
Stars: ✭ 52 (-65.56%)
Mutual labels:  design-patterns

Logo - PHP 8.1 Design Patterns

Licence Package Stars

Everyweek a new Pattern + Article on www.medium.com/@anhaia.gabriel and www.medium.com/mestredev

PHP 8.1 - Design Patterns

This repository was created to show the implementation of a variety of Design Patterns using PHP 8. There is no dependency on a framework, and the examples are the most real as possible based on my own experiences solving real-life problems. Once you learn the design pattern and its concept, it will be effortless to apply it in any PHP project.

Patterns implemented + Article

# 📖 Pattern Code Example / Implementation ✍️ Article / Post 📚
1 Adapter HERE LEARN HERE 📖
2 Facade HERE LEARN HERE 📖
3 Template Method HERE LEARN HERE 📖
4 Strategy HERE LEARN HERE 📖
5 Abstract Factory HERE Soon
6 Builder HERE Soon
7 Composite HERE Soon
8 Decorator HERE Soon
9 Factory Method HERE Soon
10 Flyweight HERE Soon
11 Iterator HERE Soon
12 Memento HERE Soon
13 Money HERE Soon
14 Null Object HERE Soon
15 Observer HERE Soon
16 Prototype HERE Soon
17 Proxy HERE Soon
18 Singleton HERE Soon
19 State HERE Soon

Coming soon

  • Bridge
  • Chain of Responsibility
  • Command
  • Interpreter
  • Mediator
  • Object Pool
  • Visitor

Dependencies

Running the project

I strongly recommend that you follow the articles (links above) and run them with Docker. It will be much easier, and you need to install Docker on your computer, independent of the OS you are using. With a few commands, you will run/test all the Design Patterns implemented throughout the course .

Build de container:

# docker build -t design-patterns . or if you prefer # make build

Run the following commands in order to test the design patterns:

# make help and then you will see the list of commands

You just need to run the command with the pattern you want to test, for example:

# make strategy

Additional Information

  • If you take a look at the examples into the blog, or inside the folders /src/{$pattern_name}/ you will notice that in almost all the examples contain a folder called components, those folders are the files/classes used to demonstrate how to use each pattern. Never consider what is in there as part of the pattern! They are not examples to be followed in your applications.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].