| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public function handle($request, Closure $next) |
||
| 11 | { |
||
| 12 | $response = $next($request); |
||
| 13 | |||
| 14 | if (! $response instanceof Response) { |
||
| 15 | return $response; |
||
| 16 | } |
||
| 17 | |||
| 18 | if (! $this->containsBodyTag($response)) { |
||
| 19 | return $response; |
||
| 20 | } |
||
| 21 | |||
| 22 | return $this->addCookieConsentScriptToResponse($response); |
||
| 23 | } |
||
| 24 | |||
| 54 |
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: