PHP DDD Factory Generator
Generates robust Domain-Driven Design (DDD) Factories for PHP 8.4 to manage complex object instantiation and validation.
The PHP DDD Factory Generator automates the creation of domain-compliant factories, ensuring that complex domain objects are instantiated in a valid state while encapsulating creation logic. It supports both static and instance-based factories, providing semantic named constructors and reconstitution methods for persistence hydration. By adhering to Clean Architecture and SOLID principles, this skill helps developers maintain a pure domain layer and provides comprehensive unit tests for all generated creation paths.
主な機能
01Ensures domain integrity by enforcing validation logic within the creation process.
0245 GitHub stars
03Implements semantic named constructors like createFromSource() for clear domain intent.
04Generates PHP 8.4 DDD-compliant Factory classes and unit tests automatically.
05Includes reconstitution methods specifically for hydrating objects from persistence without re-validation.
06Supports both Static Factories for simple logic and Instance Factories for dependency-heavy creation.
ユースケース
01Reconstituting Entities from database storage while maintaining encapsulation.
02Creating complex Domain Aggregates that require multi-step validation or mapping.
03Managing multiple creation paths for the same object, such as different user roles or order types.