\EasyWeChat\Kernel\TraitsObservable

Trait Observable.

Summary

Methods
Properties
Constants
push()
unshift()
observe()
on()
dispatch()
notify()
getHandlers()
No public properties found
No constants found
newClause()
callHandler()
makeClosure()
resolveHandlerAndCondition()
$handlers
$clauses
N/A
No private methods found
No private properties found
N/A

Properties

$handlers

$handlers : array

Type

array

$clauses

$clauses : array

Type

array

Methods

dispatch()

dispatch(string|integer  $event, mixed  ...$payload) : mixed|null

Parameters

string|integer $event
mixed $payload variadic

Returns

mixed|null

notify()

notify(string|integer  $event, mixed  ...$payload) : mixed|null

Parameters

string|integer $event
mixed $payload variadic

Returns

mixed|null

getHandlers()

getHandlers() : array

Returns

array

callHandler()

callHandler(callable  $handler, mixed  $payload) : mixed

Parameters

callable $handler
mixed $payload

Returns

mixed

makeClosure()

makeClosure(  $handler) : \Closure

Parameters

$handler

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
\ReflectionException

Returns

\Closure

resolveHandlerAndCondition()

resolveHandlerAndCondition(  $handler,   $condition) : array

Parameters

$handler
$condition

Throws

\EasyWeChat\Kernel\Exceptions\InvalidArgumentException
\ReflectionException

Returns

array