symfony/event-dispatcher-contracts
Interfaces and base abstractions for Symfony’s event dispatching system. Use these contracts to standardize how events and listeners interact, and to build libraries compatible with Symfony components and their proven implementations.
Event class already extends Symfony\Contracts\EventDispatcher\Event, so minimal changes are needed for basic adoption.Symfony\Contracts\EventDispatcher\Event subclasses) or a bridge (e.g., laravel-psr-event-dispatcher). No direct integration with Laravel’s EventServiceProvider or event() helper without custom logic.Symfony\Contracts\EventDispatcher\Event).broadcastOn). Potential for fragmentation if multiple PSR-14 implementations (e.g., Symfony’s dispatcher vs. Laravel’s) behave differently.Symfony\Contracts\EventDispatcher\Event? If not, what’s the migration effort?laravel-psr-event-dispatcher)? If not, is the team willing to maintain a custom adapter?symfony/event-dispatcher + a PSR-14 bridge).EventServiceProvider, event() helper).Symfony\Contracts\EventDispatcher\Event (or implement EventInterface).
// Before (Laravel-native)
class UserRegistered implements ShouldBroadcast {}
// After (PSR-14 compliant)
class UserRegistered extends Symfony\Contracts\EventDispatcher\Event
{
public function __construct(public User $user) {}
}
EventServiceProvider bindings with PSR-14-compatible listeners (if using a bridge like laravel-psr-event-dispatcher).EventDispatcherInterface).Symfony\Contracts\EventDispatcher\Event.laravel-psr-event-dispatcher) to connect Laravel’s dispatcher to PSR-14 listeners.Event class extending Symfony\Contracts\EventDispatcher\Event.symfony/event-dispatcher alongside Laravel (via a PSR-14 bridge).league/event, symfony/event-dispatcher).UserRegistered) as PSR-14-compliant classes.EventDispatcherInterface).Event base class).laravel-psr-event-dispatcher), it must be kept updated with Laravel’s changes.dispatch() vs. Symfony’s dispatch()), requiring clear documentation.symfony/var-dumper).EventInterface).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Event not dispatched | Listeners miss critical updates. | Use symfony/var-dumper to inspect event objects; validate dispatcher config. |
| Incompatible PSR-14 implementations | Events behave differently across |
How can I help you explore Laravel packages today?