PublishingEventDispatcher implements EventDispatcherInterface
FinalYes
Publishes registry change events onto a notification bus, then passes them on.
PSR-14 splits dispatching from listener registration, and the SDK is only
handed the dispatcher half — so it cannot register a listener on an
application's own dispatcher. This decorator is the way round that: configure
a bus and the SDK wraps whatever dispatcher it was given (or stands in for
one), so a runtime registerTool() reaches a listening client without the
caller wiring anything.
An application with its own listener provider can skip this and register RegistryChangePublisher::listeners() itself.
Tags
Table of Contents
Interfaces
- EventDispatcherInterface
Properties
- $inner : EventDispatcherInterface|null
- $listeners : array<class-string, callable(object): void>
Methods
- __construct() : mixed
- dispatch() : object
Properties
$inner read-only
private
EventDispatcherInterface|null
$inner
= null
$listeners read-only
private
array<class-string, callable(object): void>
$listeners
Methods
__construct()
public
__construct(NotificationBusInterface $bus[, EventDispatcherInterface|null $inner = null ]) : mixed
Parameters
- $bus : NotificationBusInterface
- $inner : EventDispatcherInterface|null = null
dispatch()
public
dispatch(object $event) : object
Parameters
- $event : object