DiscordPHP Documentation

Handlers
in package

This class contains all the handlers for the individual WebSocket events.

Tags
since
2.1.3

Table of Contents

$handlers  : array<string|int, mixed>
An array of handlers.
__construct()  : mixed
Constructs the list of handlers.
addHandler()  : void
Adds a handler to the list.
getHandler()  : array<string|int, mixed>|null
Returns a handler.
getHandlerKeys()  : array<string|int, mixed>
Returns the handlers.
getHandlers()  : array<string|int, mixed>
Returns the handlers array.
removeHandler()  : void
Removes a handler.

Properties

$handlers

An array of handlers.

protected array<string|int, mixed> $handlers = []

Array of handlers.

Methods

__construct()

Constructs the list of handlers.

public __construct() : mixed
Return values
mixed

addHandler()

Adds a handler to the list.

public addHandler(string $event, string $classname[, array<string|int, mixed> $alternatives = [] ]) : void
Parameters
$event : string

The WebSocket event name.

$classname : string

The Event class name.

$alternatives : array<string|int, mixed> = []

Alternative event names for the handler.

Return values
void

getHandler()

Returns a handler.

public getHandler(string $event) : array<string|int, mixed>|null
Parameters
$event : string

The WebSocket event name.

Return values
array<string|int, mixed>|null

The Event class name or null;

getHandlerKeys()

Returns the handlers.

public getHandlerKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of handler events.

getHandlers()

Returns the handlers array.

public getHandlers() : array<string|int, mixed>
Return values
array<string|int, mixed>

Array of handlers.

removeHandler()

Removes a handler.

public removeHandler(string $event) : void
Parameters
$event : string

The event handler to remove.

Return values
void

Search results