PHP Class Psr7Middlewares\Middleware\TrailingSlash

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

Public Methods

Method Description
__construct ( boolean $addSlash = false ) Configure whether add or remove the slash.
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.

Method Details

__construct() public method

Configure whether add or remove the slash.
public __construct ( boolean $addSlash = false )
$addSlash boolean

__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