1 | <?php |
||
23 | class FinalMiddleware implements MiddlewareInterface |
||
24 | { |
||
25 | /** @var RendererAdapterInterface */ |
||
26 | private $templateRenderer; |
||
27 | /** @var ConfigInterface */ |
||
28 | private $templateConfig; |
||
29 | |||
30 | /** |
||
31 | * FinalMiddleware constructor. |
||
32 | * |
||
33 | * @param RendererAdapterInterface $templateRenderer |
||
34 | * @param ConfigInterface $templateConfig |
||
35 | */ |
||
36 | public function __construct(RendererAdapterInterface $templateRenderer, ConfigInterface $templateConfig) |
||
41 | |||
42 | /** |
||
43 | * Sends out the headers and prints the response body to the output. |
||
44 | * |
||
45 | * @param ServerRequestInterface $request |
||
46 | * @param ResponseInterface $response |
||
47 | * |
||
48 | * @return ResponseInterface |
||
49 | */ |
||
50 | public function __invoke(ServerRequestInterface &$request, ResponseInterface $response) |
||
91 | |||
92 | /** |
||
93 | * Inject the Content-Length header if is not already present. |
||
94 | * |
||
95 | * @param ResponseInterface $response |
||
96 | * |
||
97 | * @return ResponseInterface |
||
98 | */ |
||
99 | private function injectContentLength(ResponseInterface $response) |
||
107 | |||
108 | /** |
||
109 | * Filter a header name to word case. |
||
110 | * |
||
111 | * @param string $headerName |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | private function filterHeaderName($headerName) |
||
121 | } |
||
122 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: