Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | public function handle($request, Closure $next) |
||
28 | { |
||
29 | $response = $next($request); |
||
30 | |||
31 | if (!$response instanceof Response) { |
||
32 | return $response; |
||
33 | } |
||
34 | |||
35 | if (! $this->containsBodyTag($response)) { |
||
36 | return $response; |
||
37 | } |
||
38 | |||
39 | return $this->addCookieConsentScriptToResponse($response); |
||
40 | } |
||
41 | |||
72 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: