1 | <?php |
||
14 | class DebugBar |
||
15 | { |
||
16 | use Utils\HtmlInjectorTrait; |
||
17 | use Utils\AttributeTrait; |
||
18 | |||
19 | /** |
||
20 | * @var Bar|null The debugbar |
||
21 | */ |
||
22 | private $debugBar; |
||
23 | |||
24 | /** |
||
25 | * @var bool Whether send data using headers in ajax requests |
||
26 | */ |
||
27 | private $captureAjax = false; |
||
28 | |||
29 | /** |
||
30 | * Constructor. Set the debug bar. |
||
31 | * |
||
32 | * @param Bar|null $debugBar |
||
33 | */ |
||
34 | public function __construct(Bar $debugBar = null) |
||
38 | |||
39 | /** |
||
40 | * Configure whether capture ajax requests to send the data with headers. |
||
41 | * |
||
42 | * @param bool $captureAjax |
||
43 | * |
||
44 | * @return self |
||
45 | */ |
||
46 | public function captureAjax($captureAjax = true) |
||
52 | |||
53 | /** |
||
54 | * Execute the middleware. |
||
55 | * |
||
56 | * @param ServerRequestInterface $request |
||
57 | * @param ResponseInterface $response |
||
58 | * @param callable $next |
||
59 | * |
||
60 | * @return ResponseInterface |
||
61 | */ |
||
62 | public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next) |
||
114 | } |
||
115 |