GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 6122da...bfe9a2 )
by Freek
10:18 queued 11s
created

CsrfTokenReplacer::replaceInCachedResponse()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12

Duplication

Lines 12
Ratio 100 %

Importance

Changes 0
Metric Value
dl 12
loc 12
rs 9.8666
c 0
b 0
f 0
cc 2
nc 2
nop 1
1
<?php
2
3
namespace Spatie\ResponseCache\Replacers;
4
5
use Symfony\Component\HttpFoundation\Response;
6
7
class CsrfTokenReplacer implements Replacer
8
{
9
    protected string $replacementString = '<laravel-responsecache-csrf-token-here>';
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
10
11
    public function prepareResponseToCache(Response $response): void
12
    {
13
        if (! $response->getContent()) {
14
            return;
15
        }
16
17
        $response->setContent(str_replace(
18
            csrf_token(),
19
            $this->replacementString,
20
            $response->getContent()
21
        ));
22
    }
23
24
    public function replaceInCachedResponse(Response $response): void
25
    {
26
        if (! $response->getContent()) {
27
            return;
28
        }
29
30
        $response->setContent(str_replace(
31
            $this->replacementString,
32
            csrf_token(),
33
            $response->getContent()
34
        ));
35
    }
36
}
37