bootdesk/chat-sdk

MiddlewareDispatcher
in package

FinalYes

Table of Contents

Properties

$middlewares  : array{webhook: array{0: object, 1: int}[], receiving: array{0: object, 1: int}[], sending: array{0: object, 1: int}[], webhook_event: array{0: object, 1: int}[], sent: array{0: object, 1: int}[], heard: array{0: object, 1: int}[]}
$sorted  : array<string, bool>

Methods

addHeard()  : void
addReceiving()  : void
addSending()  : void
addSent()  : void
addWebhook()  : void
addWebhookEvent()  : void
getMiddlewares()  : array<string|int, WebhookMiddleware>|array<string|int, ReceivingMiddleware>|array<string|int, SendingMiddleware>|array<string|int, WebhookEventMiddleware>|array<string|int, SentMiddleware>|array<string|int, HeardMiddleware>
processHeard()  : MessageContext|null
processReceiving()  : Message|null
processSending()  : PostableMessage|null
processSent()  : SentMessage
processWebhook()  : ResponseInterface
processWebhookEvent()  : Adapter
buildPipeline()  : mixed
callMiddleware()  : mixed
ensureSorted()  : void
process()  : mixed

Properties

$middlewares

private array{webhook: array{0: object, 1: int}[], receiving: array{0: object, 1: int}[], sending: array{0: object, 1: int}[], webhook_event: array{0: object, 1: int}[], sent: array{0: object, 1: int}[], heard: array{0: object, 1: int}[]} $middlewares = ['webhook' => [], 'receiving' => [], 'sending' => [], 'webhook_event' => [], 'sent' => [], 'heard' => []]

$sorted

private array<string, bool> $sorted = ['webhook' => true, 'receiving' => true, 'sending' => true, 'webhook_event' => true, 'sent' => true, 'heard' => true]

Methods

getMiddlewares()

public getMiddlewares("webhook"|"receiving"|"sending"|"webhook_event"|"sent"|"heard" $type) : array<string|int, WebhookMiddleware>|array<string|int, ReceivingMiddleware>|array<string|int, SendingMiddleware>|array<string|int, WebhookEventMiddleware>|array<string|int, SentMiddleware>|array<string|int, HeardMiddleware>
Parameters
$type : "webhook"|"receiving"|"sending"|"webhook_event"|"sent"|"heard"
Return values
array<string|int, WebhookMiddleware>|array<string|int, ReceivingMiddleware>|array<string|int, SendingMiddleware>|array<string|int, WebhookEventMiddleware>|array<string|int, SentMiddleware>|array<string|int, HeardMiddleware>

processSent()

public processSent(string $threadId, PostableMessage $message, SentMessage $result, Adapter $adapter, string $operation, callable(string, PostableMessage, SentMessage, Adapter, string): SentMessage $handler) : SentMessage
Parameters
$threadId : string
$message : PostableMessage
$result : SentMessage
$adapter : Adapter
$operation : string
$handler : callable(string, PostableMessage, SentMessage, Adapter, string): SentMessage
Return values
SentMessage

processWebhook()

public processWebhook(ServerRequestInterface $request, callable(ServerRequestInterface): ResponseInterface $handler) : ResponseInterface
Parameters
$request : ServerRequestInterface
$handler : callable(ServerRequestInterface): ResponseInterface
Return values
ResponseInterface

buildPipeline()

private buildPipeline(array<string|int, array{0: object, 1: int}> $middlewares, mixed $context, callable $handler) : mixed
Parameters
$middlewares : array<string|int, array{0: object, 1: int}>
$context : mixed
$handler : callable

callMiddleware()

private callMiddleware(object $m, array<string|int, mixed> $args, callable $next) : mixed
Parameters
$m : object
$args : array<string|int, mixed>
$next : callable

process()

private process("webhook"|"receiving"|"sending"|"sent"|"heard" $type, mixed $context, callable $handler) : mixed
Parameters
$type : "webhook"|"receiving"|"sending"|"sent"|"heard"
$context : mixed
$handler : callable
On this page

Search results