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.

CacheConfig::getCacheKey()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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