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.

NoStaleCacheEvent   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 67
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 0
dl 0
loc 67
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getCache() 0 4 1
A getKey() 0 4 1
A getCachedCallable() 0 4 1
A getTtl() 0 4 1
A setResult() 0 4 1
A hasResult() 0 4 1
A getResult() 0 4 1
1
<?php
2
namespace Metaphore;
3
4
use Metaphore\Cache;
5
use Metaphore\Ttl;
6
7
class NoStaleCacheEvent
8
{
9
    protected $cache;
10
11
    protected $key;
12
13
    protected $cachedCallable;
14
15
    protected $ttl;
16
17
    protected $result = null;
18
19
    public function __construct(Cache $cache, $key, callable $cachedCallable, Ttl $ttl)
20
    {
21
        $this->cache = $cache;
22
        $this->key = $key;
23
        $this->cachedCallable = $cachedCallable;
24
        $this->ttl = $ttl;
25
    }
26
27
    /**
28
     * @return Cache
29
     */
30
    public function getCache()
31
    {
32
        return $this->cache;
33
    }
34
35
    /**
36
     * @return string
37
     */
38
    public function getKey()
39
    {
40
        return $this->key;
41
    }
42
43
    /**
44
     * @return callable
45
     */
46
    public function getCachedCallable()
47
    {
48
        return $this->cachedCallable;
49
    }
50
51
    /**
52
     * @return Ttl
53
     */
54
    public function getTtl()
55
    {
56
        return $this->ttl;
57
    }
58
59
    public function setResult($result)
60
    {
61
        $this->result = $result;
62
    }
63
64
    public function hasResult()
65
    {
66
        return ($this->result !== null);
67
    }
68
69
    public function getResult()
70
    {
71
        return $this->result;
72
    }
73
}
74