phpbotgram

RequestMiddlewareManager
in package
implements ArrayAccess, Countable

FinalYes
Tags
implements

Table of Contents

Interfaces

ArrayAccess
Countable

Properties

$chainCache  : WeakMap<Closure, Closure>
Cached wrapped chain — invalidated on register/unregister. WeakMap keyed by terminal closure: spl_object_id collisions after GC are a real risk if an ephemeral closure is wrapped, so WeakMap (PHP 8+) gives identity-keyed lookup that auto-evicts when the terminal closure is collected.
$middlewares  : array<int, BaseRequestMiddleware>

Methods

__construct()  : mixed
__invoke()  : BaseRequestMiddleware)
Decorator-factory entry point (mirrors aiogram's MiddlewareManager.__call__).
count()  : int
offsetExists()  : bool
offsetGet()  : BaseRequestMiddleware
offsetSet()  : void
offsetUnset()  : void
register()  : BaseRequestMiddleware
unregister()  : bool
wrap()  : Closure

Properties

$chainCache

Cached wrapped chain — invalidated on register/unregister. WeakMap keyed by terminal closure: spl_object_id collisions after GC are a real risk if an ephemeral closure is wrapped, so WeakMap (PHP 8+) gives identity-keyed lookup that auto-evicts when the terminal closure is collected.

private WeakMap<Closure, Closure> $chainCache

Methods

__invoke()

Decorator-factory entry point (mirrors aiogram's MiddlewareManager.__call__).

public __invoke([BaseRequestMiddleware|null $middleware = null ]) : BaseRequestMiddleware)

Call $manager() to get a registration closure, or $manager($middleware) to register inline.

Parameters
$middleware : BaseRequestMiddleware|null = null
Return values
BaseRequestMiddleware)

offsetSet()

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
On this page

Search results