Events
in package
Table of Contents
- $compiler : Compiler
- $definedEvents : array<string|int, mixed>
- $events : array<string|int, mixed>
- __construct() : mixed
- Constructor
- define() : mixed
- Define new events
- isDefined() : bool
- Is an event defined
- register() : mixed
- Register a callback to an event
- trigger() : mixed
- Trigger an event
Properties
$compiler
protected
Compiler
$compiler
$definedEvents
protected
array<string|int, mixed>
$definedEvents
$events
protected
array<string|int, mixed>
$events
= []
Methods
__construct()
Constructor
public
__construct(Compiler $compiler[, array<string|int, mixed> $definedEvents = [] ]) : mixed
Parameters
- $compiler : Compiler
- $definedEvents : array<string|int, mixed> = []
Return values
mixed —define()
Define new events
public
define(string|array<string|int, mixed> $events) : mixed
Parameters
- $events : string|array<string|int, mixed>
Return values
mixed —isDefined()
Is an event defined
public
isDefined(string $event) : bool
Parameters
- $event : string
Return values
bool —register()
Register a callback to an event
public
register(string $event, array<string|int, mixed>|callable $callable[, int $order = 10 ]) : mixed
Parameters
- $event : string
- $callable : array<string|int, mixed>|callable
- $order : int = 10
Return values
mixed —trigger()
Trigger an event
public
trigger(string $name[, array<string|int, mixed> $params = [] ][, mixed $returnValue = null ][, bool $stopOnValue = false ]) : mixed
Parameters
- $name : string
- $params : array<string|int, mixed> = []
-
Parameters for the callback
- $returnValue : mixed = null
-
Return value
- $stopOnValue : bool = false
-
Return if a value (not null) is returned from a callback