PHP Класс Zend\Expressive\ErrorMiddlewarePipe

Normal MiddlewarePipe implementations implement Zend\Stratigility\MiddlewareInterface, which can be consumed as normal middleware, but not as error middleware, as the signature for error middleware differs. This class wraps a MiddlewarePipe, and consumes its internal pipeline within a functor signature that works for error middleware. It is not implemented as an extension of MiddlewarePipe, as that class implements the MiddlewareInterface, which prevents its use as error middleware.
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( MiddlewarePipe $pipeline )
__invoke ( mixed $error, Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $out ) : Psr\Http\Message\ResponseInterface Handle an error request.

Приватные методы

Метод Описание
decorateRequest ( Psr\Http\Message\ServerRequestInterface $request ) : Request Decorate the request with the Stratigility decorator.
decorateResponse ( Psr\Http\Message\ResponseInterface $response ) : Response Decorate the response with the Stratigility decorator.
getInternalPipeline ( ) : SplQueue Retrieve the internal pipeline from the composed MiddlewarePipe.

Описание методов

__construct() публичный Метод

public __construct ( MiddlewarePipe $pipeline )
$pipeline Zend\Stratigility\MiddlewarePipe

__invoke() публичный Метод

This is essentially a version of the MiddlewarePipe that acts as a pipeline for solely error middleware; it's primary use case is to allow configuring arrays of error middleware as a single pipeline. Operation is identical to MiddlewarePipe, with the single exception that $next is called with the $error argument.
public __invoke ( mixed $error, Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $out ) : Psr\Http\Message\ResponseInterface
$error mixed
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$out callable
Результат Psr\Http\Message\ResponseInterface