How valeragav/patterns-php works
This repository is a PHP design-pattern learning catalog, not an application with one end-to-end business workflow. A reader uses the README to choose a pattern family, then consults its standalone PHP example. The directory-level nodes represent the documented pattern families and their examples; the sampled Chain and State modules are also shown individually. Edges between runtime components are limited to calls visible in excerpts. Other examples are not individually expanded, and unsampled implementations may have additional relationships.
Main entry points: Chain.php Junior handler · Builder.php Text builder · Repository.php Persistence contract · State.php Task state
Components 20
Creational
- Object creation
creational - Builder operator
creational/Builder.php - Text builder
creational/Builder.php - Message
creational/Builder.php
Structural
- Object structure
structural
Behavioral
- Object behavior
behavioral - Handler chain
behavioral/Chain.php - Task interface
behavioral/Chain.php - Junior handler
behavioral/Chain.php - Middle handler
behavioral/Chain.php - Senior handler
behavioral/Chain.php - Task state
behavioral/State.php - State contract
behavioral/State.php - Post repository
behavioral/Repository.php - Persistence contract
behavioral/Repository.php - In-memory store
behavioral/Repository.php
Additional
- Additional patterns
additionally - Login server
additionally/ChainOfResponsibility.php - Middleware chain
additionally/ChainOfResponsibility.php
Other components
- Reader
Connections 13
- Reader → Object creation: chooses family
README.md - Reader → Object structure: chooses family
README.md - Reader → Object behavior: chooses family
README.md - Reader → Additional patterns: chooses family
README.md - Junior handler → Middle handler: delegates to
behavioral/Chain.php - Middle handler → Senior handler: delegates to
behavioral/Chain.php - Junior handler → Task interface: processes
behavioral/Chain.php - Task state → State contract: calls transition
behavioral/State.php - Post repository → Persistence contract: retrieves and saves
behavioral/Repository.php - Persistence contract → In-memory store: implemented by
behavioral/Repository.php - Builder operator → Text builder: calls build steps
creational/Builder.php - Text builder → Message: assembles
creational/Builder.php - Login server → Middleware chain: dispatches login
additionally/ChainOfResponsibility.php