Skip to content
docsv0.12.0

EventDeclaration

What an emitter says about one event it dispatches — so the house can answer «what events exist?» from the emitters themselves, never from a scan of source (greenhouse decisions/0228). The name is the string handed to `dispatch()`; `dispatchedBy` the class that dispatches it; `when` one sentence on the moment it fires; `subjectKey`/`subjectType` what the payload carries and under which key; `mutable` whether a subscriber may change the subject in place; `interceptable` whether the payload carries an `InterceptionSlot` a subscriber may stop or short-circuit. A declaration describes; it never dispatches.

EventDeclaration::__construct()

public function __construct(string $name, string $dispatchedBy, string $when, string $subjectKey = 'event', ?string $subjectType = null, bool $mutable = false, bool $interceptable = false):

Parameters

Parameters of __construct()
NameTypeDescription
$namestring
$dispatchedByclass-string
$whenstring
$subjectKeystring
$subjectType?string
$mutablebool
$interceptablebool

EventDeclaration::toArray()

public function toArray(): array

The declaration as data, the shape a catalogue prints.