PHP Class Psr7Middlewares\Middleware\SaveResponse

Inheritance: use trait Psr7Middlewares\Utils\FileTrait
Mostrar archivo Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__invoke ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.

Private Methods

Method Description
canSave ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response ) : boolean Check whether the response can be saved or not.
writeStream ( Psr\Http\Message\StreamInterface $stream, string $path ) Write the stream to the given path.

Method Details

__invoke() public method

Execute the middleware.
public __invoke ( Psr\Http\Message\RequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\RequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface