1 | <?php |
||
8 | class CookieConsentMiddleware |
||
9 | { |
||
10 | public function handle($request, Closure $next) |
||
24 | |||
25 | protected function containsBodyTag(Response $response): bool |
||
29 | |||
30 | /** |
||
31 | * @param \Illuminate\Http\Response $response |
||
32 | * |
||
33 | * @return $this |
||
34 | */ |
||
35 | protected function addCookieConsentScriptToResponse(Response $response) |
||
48 | |||
49 | protected function getLastClosingBodyTagPosition(string $content = '') |
||
53 | } |
||
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: