1 | <?php |
||
12 | class TrailingSlash |
||
13 | { |
||
14 | use Utils\RedirectTrait; |
||
15 | |||
16 | /** |
||
17 | * @var bool Add or remove the slash |
||
18 | */ |
||
19 | private $addSlash; |
||
20 | |||
21 | /** |
||
22 | * Configure whether add or remove the slash. |
||
23 | * |
||
24 | * @param bool $addSlash |
||
25 | */ |
||
26 | public function __construct($addSlash = false) |
||
30 | |||
31 | /** |
||
32 | * Execute the middleware. |
||
33 | * |
||
34 | * @param ServerRequestInterface $request |
||
35 | * @param ResponseInterface $response |
||
36 | * @param callable $next |
||
37 | * |
||
38 | * @return ResponseInterface |
||
39 | */ |
||
40 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
65 | } |
||
66 |