Creates a composed Guzzle handler function by stacking middlewares on top of
an HTTP handler function.
- final
- Implements
Stringable
Methods |
public __construct(?callable $handler = NULL)
|
public __invoke(Psr\Http\Message\RequestInterface $request, array $options) Invokes the handler stack as a composed handler
|
public __toString() : string Dumps a string representation of the stack.
|
public after(string $findName, callable $middleware, string $withName = '') : void Add a middleware after another middleware by name.
|
public before(string $findName, callable $middleware, string $withName = '') : void Add a middleware before another middleware by name.
|
public static create(?callable $handler = NULL) : self Creates a default handler stack that can be used by clients. The returned handler will wrap the provided handler or use the most The returned handler stack can be passed to a client in the "handler"
|
public hasHandler() : bool Returns true if the builder has a handler. |
public push(callable $middleware, string $name = '') : void Push a middleware to the top of the stack.
|
public remove( $remove) : void Remove a middleware by instance or name from the stack.
|
public resolve() : callable Compose the middleware and handler into a single callable function.
|
public setHandler(callable $handler) : void Set the HTTP handler that actually returns a promise.
|
public unshift(callable $middleware, ?string $name = NULL) : void Unshift a middleware to the bottom of the stack.
|
Properties |
private $cached = NULL
|
private $handler = NULL
|
private $stack = []
|
Methods |
private debugCallable( $fn) : string Provides a debug string for a given callable.
|
private findByName(string $name) : int |
private splice(string $findName, string $withName, callable $middleware, bool $before) : void Splices a function into the middleware list at a specific position. |
Methods |
public static create(?callable $handler = NULL) : self Creates a default handler stack that can be used by clients. The returned handler will wrap the provided handler or use the most The returned handler stack can be passed to a client in the "handler"
|