1 | <?php |
||
13 | trait HtmlInjectorTrait |
||
14 | { |
||
15 | /** |
||
16 | * Inject some code just before any tag. |
||
17 | * |
||
18 | * @param ResponseInterface $response |
||
19 | * @param string $code |
||
20 | * @param string $tag |
||
21 | * |
||
22 | * @return ResponseInterface |
||
23 | */ |
||
24 | private function inject(ResponseInterface $response, $code, $tag = 'body') |
||
40 | |||
41 | /** |
||
42 | * Check whether the request is valid to insert html in the response. |
||
43 | * |
||
44 | * @param ServerRequestInterface $request |
||
45 | * |
||
46 | * @return bool |
||
47 | */ |
||
48 | private function isInjectable(ServerRequestInterface $request) |
||
66 | } |
||
67 |