1 | <?php |
||
14 | class DebugBar |
||
15 | { |
||
16 | private $debugBar; |
||
17 | |||
18 | /** |
||
19 | * Constructor. Set the debug bar. |
||
20 | * |
||
21 | * @param Bar|null $debugBar |
||
22 | */ |
||
23 | public function __construct(Bar $debugBar = null) |
||
29 | |||
30 | /** |
||
31 | * Set the debug bar. |
||
32 | * |
||
33 | * @param Bar $debugBar |
||
34 | * |
||
35 | * @return self |
||
36 | */ |
||
37 | public function debugBar(Bar $debugBar) |
||
43 | |||
44 | /** |
||
45 | * Execute the middleware. |
||
46 | * |
||
47 | * @param ServerRequestInterface $request |
||
48 | * @param ResponseInterface $response |
||
49 | * @param callable $next |
||
50 | * |
||
51 | * @return ResponseInterface |
||
52 | */ |
||
53 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
76 | |||
77 | /** |
||
78 | * Check whether the request is valid to insert a debugbar in the response. |
||
79 | * |
||
80 | * @param ServerRequestInterface $request |
||
81 | * |
||
82 | * @return bool |
||
83 | */ |
||
84 | private function isValid(ServerRequestInterface $request) |
||
102 | } |
||
103 |