Learn how to implement the most important Design Patterns into your PHP application, uses PHP 8.1

Overview

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.
You might also like...
30 seconds of code Short PHP code snippets for all your development needs
30 seconds of code Short PHP code snippets for all your development needs

30 seconds of code Short PHP code snippets for all your development needs Visit our website to view our snippet collection. Use the Search page to fin

Generates documentation for your REST API from annotations

NelmioApiDocBundle The NelmioApiDocBundle bundle allows you to generate a decent documentation for your APIs. Migrate from 3.x to 4.0 To migrate from

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Generate interactive OpenAPI documentation for your RESTful API using doctrine annotations

Documentation Generator for PHP

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

Documentation generator for PHP Code using standard technology (SRC, DOCBLOCK, XML and XSLT)

phpDox phpDox is a documentation generator for PHP projects. This includes, but is not limited to, API documentation. The main focus is on enriching t

A php API documentation generator, fork of Sami

Doctum, a PHP API documentation generator. Fork of Sami Curious about what Doctum generates? Have a look at the MariaDB MySQL Kbs or Laravel documenta

Industrial-strength annotations for PHP

php-annotations Source-code annotations for PHP. Copyright (C) 2011-2015 Rasmus Schultz [email protected] https://github.com/php-annotations/php-anno

A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。
A PHP framework foucs on API fast development.接口,从简单开始!PhalApi简称π框架,一个轻量级PHP开源接口框架,专注于接口服务开发。

PhalApi开源接口框架 / PhalApi API Framework 读音:派框架 Stargazers over time 开发文档 / Documents 专为PHPer准备的优雅而详细的开发文档,请看:PhalApi 2.x 开发文档。 PhalApi 2.x English Docs.

Source Code for 'PHP 8 Solutions' by David Powers
Source Code for 'PHP 8 Solutions' by David Powers

Apress Source Code This repository accompanies PHP 8 Solutions by David Powers (Apress, 2022). Download the files as a zip using the green button, or

Owner
Gabriel Anhaia
Book "Design Patterns with PHP 7" https://www.casadocodigo.com.br/products/livro-design-paterns-php
Gabriel Anhaia
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io - Deprecation Notice This repository is deprecated! Daux.io has been moved to an organization, to guarantee future development and support. So

Justin Walsh 4.6k Dec 16, 2022
Daux.io is an documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It helps you create great looking documentation in a developer friendly way.

Daux.io Daux.io is a documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly. It help

Daux.io 719 Jan 1, 2023
Some design pattern to practice

Design Pattern by HeadFirst Design Pattern Book. 1. Strategy Pattern (Policy Pattern) Design Principle: Identify the aspects of your application that

null 0 Oct 23, 2021
phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to generate a complete set of API Documentation

phpDocumentor What is phpDocumentor? phpDocumentor is an application that is capable of analyzing your PHP source code and DocBlock comments to genera

phpDocumentor 3.7k Jan 3, 2023
FluxBB is a fast, light, user-friendly forum application for your website.

FluxBB 1.5 Readme About FluxBB is an open source forum application released under the GNU General Public Licence. It is free to download and use and w

FluxBB 477 Dec 27, 2022
Ladumor Laravel Swagger help to setup swagger in your application easily

Laravel Swagger Installation Install the package by the following command, composer require ladumor/laravel-swagger Add Provider Add the provider to

Shailesh Ladumor 23 Jun 17, 2022
Application de forum des questions IT

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

null 3 Oct 11, 2021
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Dec 22, 2022
PHP 7.1 ready Smart and Simple Documentation for your PHP project

Smart and Readable Documentation for your PHP project ApiGen is the simplest, the easiest to use and the most modern api doc generator. It is all PHP

ApiGen 2.1k Apr 20, 2021
Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and / or RESTful API

Luracast Restler ![Gitter](https://badges.gitter.im/Join Chat.svg) Version 3.0 Release Candidate 5 Restler is a simple and effective multi-format Web

Luracast 1.4k Jan 2, 2023