ListenerTrait
WebSocket\Trait\ListenerTrait trait.
Provides listener functions.
Table of Contents
Properties
- $listeners : array<string|int, mixed>
Methods
- onBinary() : self
- onClose() : self
- onConnect() : self
- onDisconnect() : self
- onError() : self
- onPing() : self
- onPong() : self
- onText() : self
- onTick() : self
- dispatch() : void
Properties
$listeners
private
array<string|int, mixed>
$listeners
= []
Methods
onBinary()
public
onBinary(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonClose()
public
onClose(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonConnect()
public
onConnect(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonDisconnect()
public
onDisconnect(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonError()
public
onError(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonPing()
public
onPing(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonPong()
public
onPong(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonText()
public
onText(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfonTick()
public
onTick(Closure $closure) : self
Parameters
- $closure : Closure
Return values
selfdispatch()
private
dispatch(string $type[, array<string|int, mixed> $args = [] ]) : void
Parameters
- $type : string
- $args : array<string|int, mixed> = []