Base class for event handler with routing of event type by methods
To use, extend with your class and add methods which match desired event types. Method name laterally comes from event name by add prefix 'event' and remove slashes. Example: event type Subscriber/Created will use method to handle:
protected function eventSubscriberCreated(Event $event):void
Function must call $event->onSuccess() or $event->onProcessed() to report the result of event processing
See usage example
Methods | ||
---|---|---|
public
|
withNotFoundCode(int $code): self
|
# |
public
|
__invoke(Event $event): void
|
# |
public
|
__call($name, $arguments)
|
# |
Properties | |||
---|---|---|---|
protected
|
|
$notFoundCode = 404
|
# |