SingleSignal
MMO\core\events · 1 symbol · generated 5 Oct 2026
SingleSignal
SingleSignal.php:10Signal that is sent only one time during the application lifecycle.
- Namespace
MMO\core\events- Extends
- Signal
- Uses traits
- tSingleton
Index
| Instantiate($config) static | (Re)create the shared instance immediately, configured with $config merged into the class's existing config. | |
| IsShared() static | ||
| Send($args) static | Send this signal, but only the FIRST time it's ever called: subsequent calls (with any, even different, $args) just return the same already-dispatched instance, unchanged. | |
| Shared() static | Get the shared instance, creating (and configuring) it on first call. | |
| Unshare($serialize) static | Remove the shared instance, so the next Shared() call creates a fresh one. | |
| Value($args) static | ||
| __construct($origin) | A singleton: Send (or Shared), never new -- a second instance would dispatch a second time. |
Methods7
Instantiate($config)
statictSingleton.php:61(Re)create the shared instance immediately, configured with $config merged into the class's existing config.
| $config = [] | array | config values merged in before the instance is constructed |
| returns | static | the newly (re)created shared instance |
IsShared()
statictSingleton.php:49| returns | bool | true if the shared instance has already been created (a call to Shared() would not need to construct a new one) |
Send($args)
staticSingleSignal.php:29Send this signal, but only the FIRST time it's ever called: subsequent calls (with any, even different, $args) just return the same already-dispatched instance, unchanged.
Shared()
statictSingleton.php:22Get the shared instance, creating (and configuring) it on first call.
| returns | static |
Unshare($serialize)
statictSingleton.php:35Remove the shared instance, so the next Shared() call creates a fresh one.
- See
serialize) and kept as the class's config, so the next instance created picks up where this one left off; if false, the instance is simply discarded and the next one starts from the class's original config
| $serialize = true | bool | if true (the default) and an instance currently exists, it is serialized first (via |
| returns | bool | true if an instance actually existed and was removed |
Value($args)
staticSingleSignal.php:40| ...$args | mixed | |
| returns | mixed | the (first, and only) dispatch's Signal::getReturn |
__construct($origin)
SingleSignal.php:17A singleton: Send (or Shared), never new -- a second instance would dispatch a second time.
Inherited members (15)
| Methods | Declared by | Description | |
|---|---|---|---|
AddListener($handler, $order) | Event | Register a listener directly (as opposed to ConnectListeners's attribute-based discovery). | |
ConnectListeners($obj) | Event | Scan $obj's methods for #[Listen(EventClass::class)] attributes and register each one as a listener on the matching event class. | |
DisconnectListeners($obj) | Event | Undo a previous ConnectListeners: removes every listener that connect had registered for $obj on this event class. | |
dispatch() | Event | Invoke every GetListeners listener with $this. | |
GetListeners() | Event | Collect every listener for this class, including those registered on its parent classes (so a subclass event is also caught by listeners of its parent event), sorted by ascending $order (ties keep … | |
getOrigin() | Event | ||
getReturn() | Signal | ||
HasListener($handler) | Event | ||
hasReturn() | Signal | ||
RemoveListener($handler) | Event | Remove the last added handler from the listeners. | |
SetListenerOrder($handler, $order) | Event | Change the order of an already-registered listener, whether added directly via AddListener or indirectly via ConnectListeners (which also stores its [$obj, $methodName] callables here). | |
setReturn($value, $stop) | Signal |