Skip to content

Software design patterns simplified and implemented with modern PHP (7.4 or greater).

Notifications You must be signed in to change notification settings

sajibsrs/php-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

# Modern PHP Design Patterns

(PHP version 7.4 or greater)

# Intention

The intention is to simplify the ideas of different design patterns. The code examples are overly simplified. These examples only focuses on what's important and additional operations kept to as minimal as possible. It's more like proof of concept.

# Patterns

Example uses of design patterns can be found in index.php in the root directory. You can either run it from terminal or built-in php server.

Run from terminal:

php index.php

Run built-in server:

php -S localhost:8000

# Creational

  • Factory method
  • Abstract factory
  • Builder
  • Prototype
  • Singleton

# Structural

  • Adapter
  • Bridge
  • Composite
  • Decorator
  • Facade
  • Flyweight
  • Proxy

# Behavioral

  • Chain of responsibility
  • Command
  • Iterator
  • Mediator
  • Memento
  • Observer
  • State
  • Strategy
  • Template method
  • Visitor

Testing

Run command on project root directory:

# Run tests

./vendor/bin/phpunit --testdox --color=always

# Code coverage

XDEBUG_MODE=coverage ./vendor/bin/phpunit --coverage-text --color=always

About

Software design patterns simplified and implemented with modern PHP (7.4 or greater).

Topics

Resources

Stars

Watchers

Forks

Languages