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 ( f019a9...6afc29 )
by Christian
14:27
created

DoctrineCache   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 52
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 52
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A setItem() 0 4 1
A getItem() 0 4 1
A hasItem() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the ni-ju-san CMS.
5
 *
6
 * (c) Christian Gripp <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Core23\ShariffBundle\Cache;
13
14
use Doctrine\Common\Cache\Cache;
15
use Heise\Shariff\CacheInterface;
16
17
class DoctrineCache implements CacheInterface
18
{
19
    /**
20
     * @var Cache
21
     */
22
    protected $cache;
23
24
    /**
25
     * DoctrineCache constructor.
26
     *
27
     * @param Cache $cache
28
     */
29
    public function __construct(Cache $cache)
30
    {
31
        $this->cache = $cache;
32
    }
33
34
    /**
35
     * Set cache entry.
36
     *
37
     * @param string $key
38
     * @param string $content
39
     */
40
    public function setItem($key, $content)
41
    {
42
        $this->cache->save($key, $content);
43
    }
44
45
    /**
46
     * Get cache entry.
47
     *
48
     * @param string $key
49
     *
50
     * @return string
51
     */
52
    public function getItem($key)
53
    {
54
        return $this->cache->fetch($key);
55
    }
56
57
    /**
58
     * Check if cache entry exists.
59
     *
60
     * @param string $key
61
     *
62
     * @return bool
63
     */
64
    public function hasItem($key)
65
    {
66
        return $this->cache->contains($key);
67
    }
68
}
69