PHP Decorator Pattern Generator

•
45
•

Generates standardized PHP 8.4 Decorator patterns to dynamically add behavior to objects without inheritance.

This skill streamlines the implementation of the Decorator structural pattern in PHP 8.4 environments, specifically tailored for Clean Architecture and Domain-Driven Design (DDD) projects. It automates the creation of component interfaces, abstract base decorators, and concrete implementations for cross-cutting concerns like logging, caching, and transactional integrity. By generating boilerplate-free wrapper classes and corresponding unit tests, it ensures a modular codebase where features can be stacked at runtime while maintaining strict adherence to SOLID principles and PSR standards.

주요 기능

01Automated generation of PHP 8.4 component interfaces and abstract decorators
02Pre-configured templates for common decorators like Logging, Caching, and Metrics
03Strict adherence to Clean Architecture directory structures (Domain vs. Infrastructure)
04Automatic unit test generation for every decorator implementation
05Standardized naming conventions for consistent architectural patterns
0645 GitHub stars

사용 사례

01Implementing transparent caching layers for expensive domain operations
02Wrapping database operations in transactions using a stackable decorator approach
03Adding logging or performance monitoring to existing services without modifying source code