PHP Class Psr7Middlewares\Middleware\AuraRouter

Inheritance: use trait Psr7Middlewares\Utils\CallableTrait, use trait Psr7Middlewares\Utils\AttributeTrait
Show file Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__construct ( Aura\Router\RouterContainer $router ) Set the RouterContainer instance.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
getRoute ( Psr\Http\Message\ServerRequestInterface $request ) : Aura\Router\Route | null Returns the route instance.

Method Details

__construct() public method

Set the RouterContainer instance.
public __construct ( Aura\Router\RouterContainer $router )
$router Aura\Router\RouterContainer

__invoke() public method

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

getRoute() public static method

Returns the route instance.
public static getRoute ( Psr\Http\Message\ServerRequestInterface $request ) : Aura\Router\Route | null
$request Psr\Http\Message\ServerRequestInterface
return Aura\Router\Route | null