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 ( 64215f...a3cbf2 )
by Freek
01:36
created

ResponseCacheRepository::tags()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
namespace Spatie\ResponseCache;
4
5
use Illuminate\Cache\Repository;
6
use Symfony\Component\HttpFoundation\Response;
7
8
class ResponseCacheRepository
9
{
10
    /** @var \Illuminate\Cache\Repository */
11
    protected $cache;
12
13
    /** @var \Spatie\ResponseCache\ResponseSerializer */
14
    protected $responseSerializer;
15
16
    public function __construct(ResponseSerializer $responseSerializer, Repository $cache)
17
    {
18
        $this->cache = $cache;
19
20
        $this->responseSerializer = $responseSerializer;
21
    }
22
23
    /**
24
     * @param string $key
25
     * @param \Symfony\Component\HttpFoundation\Response $response
26
     * @param \DateTime|int $seconds
27
     */
28
    public function put(string $key, $response, $seconds)
29
    {
30
        $this->cache->put($key, $this->responseSerializer->serialize($response), $seconds);
31
    }
32
33
    public function has(string $key): bool
34
    {
35
        return $this->cache->has($key);
36
    }
37
38
    public function get(string $key): Response
39
    {
40
        return $this->responseSerializer->unserialize($this->cache->get($key));
41
    }
42
43
    public function clear()
44
    {
45
        $this->cache->clear();
46
    }
47
48
    public function forget(string $key): bool
49
    {
50
        return $this->cache->forget($key);
51
    }
52
53
    public function tags(array $tags): self
54
    {
55
        return new self($this->responseSerializer, $this->cache->tags($tags));
56
    }
57
}
58