PHP Composite Pattern Generator

•
45
•

Generates robust Composite design patterns for PHP 8.4 to manage complex tree structures and part-whole hierarchies with a uniform interface.

This skill streamlines the implementation of the Composite structural design pattern within PHP 8.4 applications, specifically tailored for Domain-Driven Design (DDD) and Clean Architecture. It automates the creation of Component interfaces, Leaf objects, and Composite containers, allowing developers to treat individual objects and compositions of objects identically. By generating standardized boilerplate and corresponding unit tests, this skill ensures type-safe, recursive structures suitable for menus, file systems, permission hierarchies, and complex calculation engines while strictly adhering to PSR standards.

主要功能

01Automates creation of Component, Leaf, and Composite components
02Provides built-in unit test generation for immediate logic verification
0345 GitHub stars
04Enforces Domain-Driven Design directory structures and naming conventions
05Prevents common anti-patterns like manual type-checking and circular references
06Generates PHP 8.4 compliant code using final readonly classes and strict typing

使用场景

01Building nested navigation menus or site maps with uniform rendering logic
02Implementing recursive pricing rules or discount engines for e-commerce
03Creating hierarchical permission systems for granular access control