This repository contains various examples of design patterns implemented in PHP. Each folder demonstrates a different pattern, with exercises and sample code to help you understand and apply these concepts in real-world scenarios.
The project is organized into the following directories, each representing a design pattern:
- adapter/: Adapter pattern examples and exercises
- builder/: Builder pattern examples and exercises
- composite/: Composite pattern examples and exercises
- decorator/: Decorator pattern examples and exercises
- facade/: Facade pattern examples and exercises
- factory_method/: Factory Method pattern examples and exercises
- iterator/: Iterator pattern examples and exercises
- observer/: Observer pattern examples and exercises
- singleton/: Singleton pattern examples
- strategy/: Strategy pattern examples and exercises
- template_method/: Template Method pattern examples and exercises
Each main folder may contain an Exercice/ subfolder with practical assignments ("travaux pratiques") that I completed during class. The rest of the project structure and code belongs to my teacher.
- Browse each pattern's folder to explore the code and exercises.
- Run the PHP scripts using the command line or your preferred development environment.
- Review the comments and structure to understand how each pattern is implemented.
- PHP 8.2 or higher
This project is for educational purposes.