| Conditions | 1 |
| Paths | 1 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | protected function addCookieConsentScriptToResponse(Response $response) |
||
| 36 | { |
||
| 37 | $content = $response->getContent(); |
||
| 38 | |||
| 39 | $closingBodyTagPosition = $this->getLastClosingBodyTagPosition($content); |
||
| 40 | |||
| 41 | $content = '' |
||
| 42 | .substr($content, 0, $closingBodyTagPosition) |
||
| 43 | .view('cookieConsent::index')->render() |
||
|
|
|||
| 44 | .substr($content, $closingBodyTagPosition); |
||
| 45 | |||
| 46 | return $response->setContent($content); |
||
| 47 | } |
||
| 48 | |||
| 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: