| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 47 | protected function addCookieConsentScriptToResponse(Response $response): Response |
||
| 48 | { |
||
| 49 | $content = $response->getContent(); |
||
| 50 | |||
| 51 | $closingBodyTagPosition = $this->getLastClosingBodyTagPosition($content); |
||
| 52 | |||
| 53 | $content = '' |
||
| 54 | . substr($content, 0, $closingBodyTagPosition) |
||
| 55 | . view('cookieConsent::index')->render() |
||
|
|
|||
| 56 | . substr($content, $closingBodyTagPosition); |
||
| 57 | |||
| 58 | return $response->setContent($content); |
||
| 59 | } |
||
| 60 | |||
| 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: