1 | <?php |
||
15 | class DebugBar |
||
16 | { |
||
17 | use Utils\HtmlInjectorTrait; |
||
18 | |||
19 | private $debugBar; |
||
20 | private $captureAjax = true; |
||
21 | |||
22 | /** |
||
23 | * Constructor. Set the debug bar. |
||
24 | * |
||
25 | * @param Bar|null $debugBar |
||
26 | */ |
||
27 | public function __construct(Bar $debugBar = null) |
||
33 | |||
34 | /** |
||
35 | * Set the debug bar. |
||
36 | * |
||
37 | * @param Bar $debugBar |
||
38 | * |
||
39 | * @return self |
||
40 | */ |
||
41 | public function debugBar(Bar $debugBar) |
||
47 | |||
48 | /** |
||
49 | * Configure whether capture ajax requests to send the data with headers |
||
50 | * |
||
51 | * @param bool $captureAjax |
||
52 | * |
||
53 | * @return self |
||
54 | */ |
||
55 | public function captureAjax($captureAjax = true) |
||
61 | |||
62 | /** |
||
63 | * Execute the middleware. |
||
64 | * |
||
65 | * @param ServerRequestInterface $request |
||
66 | * @param ResponseInterface $response |
||
67 | * @param callable $next |
||
68 | * |
||
69 | * @return ResponseInterface |
||
70 | */ |
||
71 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
114 | } |
||
115 |