Business Exception Class Generator
Generates specialized business exception classes with factory methods to enforce domain invariants and fail-fast logic.
This skill automates the creation of 'Invalide' classes, a pattern used to centralize and standardize domain-specific exceptions for PHP entities. It enforces architectural best practices such as final classes, private constructors, and static factory methods (prefixed with 'car') for expressive error handling. By verifying entity existence and following a strict template, it helps developers implement robust error management that remains consistent across the codebase, ensuring that business rules are validated efficiently and failures are handled with maximum context.
Key Features
015 GitHub stars
02Validates entity existence before generating code
03Integrates static factory methods for expressive error handling
04Implements fail-fast business logic patterns
05Enforces standardized naming conventions for exception factories
06Automated 'Invalide' class generation for PHP entities
Use Cases
01Implementing the Invalid State pattern to decouple business rules from core entity logic
02Standardizing error messages and exception types across a large backend project
03Creating domain-specific validation logic for a new Symfony or PHP entity