1 | <?php |
||
12 | class Shutdown |
||
13 | { |
||
14 | use Utils\CallableTrait; |
||
15 | |||
16 | /** |
||
17 | * @var callable|string The handler used |
||
18 | */ |
||
19 | private $handler; |
||
20 | |||
21 | /** |
||
22 | * Constructor. |
||
23 | * |
||
24 | * @param callable|string|null $handler |
||
25 | */ |
||
26 | public function __construct($handler = null) |
||
30 | |||
31 | /** |
||
32 | * Execute the middleware. |
||
33 | * |
||
34 | * @param RequestInterface $request |
||
35 | * @param ResponseInterface $response |
||
36 | * @param callable $next |
||
37 | * |
||
38 | * @return ResponseInterface |
||
39 | */ |
||
40 | public function __invoke(RequestInterface $request, ResponseInterface $response, callable $next) |
||
46 | |||
47 | public static function defaultHandler() |
||
64 | } |
||
65 |