What problem does it solve?
This Skill automates the creation of custom Symfony Events and their corresponding EventSubscribers or EventListeners, adhering to best practices and streamlining event-driven architecture in Symfony applications.
Core Features & Use Cases
- Event Generation: Creates immutable Event classes with promoted properties and getters.
- Handler Creation: Generates either an
EventSubscriber (recommended for multiple events) or an EventListener (using #[AsEventListener] attribute).
- Namespace Detection: Automatically detects the project's namespace from
composer.json or defaults to App.
- Stoppable Events: Supports the creation of stoppable events for conditional propagation.
- Use Case: Quickly scaffold the necessary classes when a new business event occurs, such as
OrderPlaced or UserRegistered, ensuring consistent implementation.
Quick Start
Use the symfony:event skill to generate a new event named OrderPlaced with associated data and a recommended EventSubscriber.