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 ( d4217a...89ef72 )
by Steffen
18:24
created

CacheConfig::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 3
1
<?php
2
3
namespace SteffenBrand\CurrCurr\Model;
4
5
use Psr\SimpleCache\CacheInterface;
6
7
class CacheConfig {
8
9
    /**
10
     * @const int
11
     */
12
    const CACHE_UNTIL_MIDNIGHT = -1;
13
14
    /**
15
     * @const string
16
     */
17
    const DEFAULT_CACHE_KEY = 'curr-curr-cache';
18
19
    /**
20
     * @var CacheInterface
21
     */
22
    private $cache;
23
24
    /**
25
     * @var int
26
     */
27
    private $cacheTimeInSeconds;
28
29
    /**
30
     * @var string
31
     */
32
    private $cacheKey;
33
34
    /**
35
     * CacheConfig constructor.
36
     *
37
     * @param CacheInterface $cache PSR-16 compliant CacheInterface implementation
38
     * @param int $cacheTimeInSeconds TTL in seconds
39
     * @param string $cacheKey Key to use for caching
40
     */
41
    public function __construct(CacheInterface $cache = null,
42
                                $cacheTimeInSeconds = self::CACHE_UNTIL_MIDNIGHT,
43
                                $cacheKey = self::DEFAULT_CACHE_KEY)
44
    {
45
        $this->cache = $cache;
46
        $this->cacheTimeInSeconds = $cacheTimeInSeconds;
47
        $this->cacheKey = $cacheKey;
48
    }
49
50
    /**
51
     * @return CacheInterface
52
     */
53
    public function getCache(): CacheInterface
54
    {
55
        return $this->cache;
56
    }
57
58
    /**
59
     * @param CacheInterface $cache
60
     */
61
    public function setCache(CacheInterface $cache)
62
    {
63
        $this->cache = $cache;
64
    }
65
66
    /**
67
     * @return int
68
     */
69
    public function getCacheTimeInSeconds(): int
70
    {
71
        return $this->cacheTimeInSeconds;
72
    }
73
74
    /**
75
     * @param int $cacheTimeInSeconds
76
     */
77
    public function setCacheTimeInSeconds(int $cacheTimeInSeconds)
78
    {
79
        $this->cacheTimeInSeconds = $cacheTimeInSeconds;
80
    }
81
82
    /**
83
     * @return string
84
     */
85
    public function getCacheKey(): string
86
    {
87
        return $this->cacheKey;
88
    }
89
90
    /**
91
     * @param string $cacheKey
92
     */
93
    public function setCacheKey(string $cacheKey)
94
    {
95
        $this->cacheKey = $cacheKey;
96
    }
97
98
}