class Event (View source)

Class Event

Methods

__construct()

Event constructor.

static Event
getInstance()

Event constructor.

static void
on(string $event, callable|string $fn, int $priority)

No description

void
listener(string $event, callable|string $fn, int $priority = 0)

Alias to on method

bool
bound(AppEvent $event)

Check whether an event is already recorded at least once.

static void
once(string $event, callable|array|string $fn, int $priority)

No description

array
getEventListeners(string $event_name)

Get the one-time listener for an event

bool|null
emit(AppEvent $event)

Dispatch event

bool|null
dispatch(AppEvent $event)

Dispatch event

static void
off(string $event)

No description

static mixed
__callStatic(string $name, array $arguments)

__callStatic

void
static() $bool dispatch(string|AppEvent $event)

No description

Details

__construct()

Event constructor.

Exceptions

Exception

static Event getInstance()

Event constructor.

Return Value

Event

static void on(string $event, callable|string $fn, int $priority)

No description

Parameters

string $event
callable|string $fn
int $priority

Return Value

void

void listener(string $event, callable|string $fn, int $priority = 0)

Alias to on method

Parameters

string $event
callable|string $fn
int $priority

Return Value

void

bool bound(AppEvent $event)

Check whether an event is already recorded at least once.

Parameters

AppEvent $event

Return Value

bool

static void once(string $event, callable|array|string $fn, int $priority)

No description

Parameters

string $event
callable|array|string $fn
int $priority

Return Value

void

array getEventListeners(string $event_name)

Get the one-time listener for an event

Parameters

string $event_name

Return Value

array

bool|null emit(AppEvent $event)

Dispatch event

Parameters

AppEvent $event

Return Value

bool|null

Exceptions

EventException

bool|null dispatch(AppEvent $event)

Dispatch event

Parameters

AppEvent $event

Return Value

bool|null

Exceptions

EventException

static void off(string $event)

No description

Parameters

string $event

Return Value

void

static mixed __callStatic(string $name, array $arguments)

__callStatic

Parameters

string $name
array $arguments

Return Value

mixed

Exceptions

ErrorException

void static() $bool dispatch(string|AppEvent $event)

No description

Parameters

) $bool dispatch(string|AppEvent $event

Return Value

void