class Event (View source)

Methods

static Event
getInstance()

Event constructor.

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

addEventListener

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

Associate a single listener to an event

static bool|null
emit(AppEvent $event)

Dispatch event

static void
off(string $event)

off removes an event saves

static bool
bound(string $event)

Check whether an event is already recorded at least once.

mixed
__call(string $name, array $arguments)

__call

Details

static Event getInstance()

Event constructor.

Return Value

Event

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

addEventListener

Parameters

string $event
callable|string $fn
int $priority

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

Associate a single listener to an event

Parameters

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

Return Value

void

static bool|null emit(AppEvent $event)

Dispatch event

Parameters

AppEvent $event

Return Value

bool|null

static void off(string $event)

off removes an event saves

Parameters

string $event

Return Value

void

static bool bound(string $event)

Check whether an event is already recorded at least once.

Parameters

string $event

Return Value

bool

mixed __call(string $name, array $arguments)

__call

Parameters

string $name
array $arguments

Return Value

mixed