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.

ApcCache::getKey()   A
last analyzed

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 Minime\Annotations\Cache;
4
5
use Minime\Annotations\Interfaces\CacheInterface;
6
7
/**
8
 * Apc cache storage implementation
9
 *
10
 * @package Minime\Annotations
11
 * @author [email protected]
12
 */
13
class ApcCache implements CacheInterface
14
{
15
    /**
16
     * Cached annotations
17
     *
18
     * @var array
19
     */
20
    protected $annotations = [];
21
22
    public function getKey($docblock)
23
    {
24
        return 'minime-annotations:' . md5($docblock);
25
    }
26
27
    public function set($key, array $annotations)
28
    {
29
        if (! apc_exists($key)) {
30
            apc_store($key, $annotations);
31
        }
32
    }
33
34
    public function get($key)
35
    {
36
        if (apc_exists($key)) {
37
            return apc_fetch($key);
38
        }
39
40
        return [];
41
    }
42
43
    public function clear()
44
    {
45
        $cache = apc_cache_info('user');
46
        foreach ($cache['cache_list'] as $entry) {
47
            if(isset($entry['info'])
48
               && strpos($entry['info'], 'minime-annotations:') === 0) {
49
                apc_delete($entry['info']);
50
            }
51
        }
52
    }
53
}
54