1441 |
ariadna |
1 |
<?php
|
|
|
2 |
|
|
|
3 |
/**
|
|
|
4 |
* Slim Framework (https://slimframework.com)
|
|
|
5 |
*
|
|
|
6 |
* @license https://github.com/slimphp/Slim/blob/4.x/LICENSE.md (MIT License)
|
|
|
7 |
*/
|
|
|
8 |
|
|
|
9 |
declare(strict_types=1);
|
|
|
10 |
|
|
|
11 |
namespace Slim\Interfaces;
|
|
|
12 |
|
|
|
13 |
use Psr\Http\Server\MiddlewareInterface;
|
|
|
14 |
use Psr\Http\Server\RequestHandlerInterface;
|
|
|
15 |
|
|
|
16 |
interface MiddlewareDispatcherInterface extends RequestHandlerInterface
|
|
|
17 |
{
|
|
|
18 |
/**
|
|
|
19 |
* Add a new middleware to the stack
|
|
|
20 |
*
|
|
|
21 |
* Middleware are organized as a stack. That means middleware
|
|
|
22 |
* that have been added before will be executed after the newly
|
|
|
23 |
* added one (last in, first out).
|
|
|
24 |
*
|
|
|
25 |
* @param MiddlewareInterface|string|callable $middleware
|
|
|
26 |
*/
|
|
|
27 |
public function add($middleware): self;
|
|
|
28 |
|
|
|
29 |
/**
|
|
|
30 |
* Add a new middleware to the stack
|
|
|
31 |
*
|
|
|
32 |
* Middleware are organized as a stack. That means middleware
|
|
|
33 |
* that have been added before will be executed after the newly
|
|
|
34 |
* added one (last in, first out).
|
|
|
35 |
*/
|
|
|
36 |
public function addMiddleware(MiddlewareInterface $middleware): self;
|
|
|
37 |
|
|
|
38 |
/**
|
|
|
39 |
* Seed the middleware stack with the inner request handler
|
|
|
40 |
*/
|
|
|
41 |
public function seedMiddlewareStack(RequestHandlerInterface $kernel): void;
|
|
|
42 |
}
|