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 ( 81d80b...d02dae )
by Bram
12s
created

CacheController::clearAction()   B

Complexity

Conditions 4
Paths 3

Size

Total Lines 23
Code Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 23
rs 8.7972
c 0
b 0
f 0
cc 4
eloc 15
nc 3
nop 0
1
<?php
2
/**
3
 * @author Bram Gerritsen [email protected]
4
 * @copyright (c) Bram Gerritsen 2013
5
 * @license http://opensource.org/licenses/mit-license.php
6
 */
7
8
namespace StrokerCache\Controller;
9
10
use StrokerCache\Exception\UnsupportedAdapterException;
11
use StrokerCache\Service\CacheService;
12
use Zend\Mvc\Console\Controller\AbstractConsoleController;
13
14
class CacheController extends AbstractConsoleController
15
{
16
    /**
17
     * @var CacheService
18
     */
19
    protected $cacheService;
20
21
    /**
22
     * Default constructor
23
     *
24
     * @param CacheService $cacheService
25
     */
26
    public function __construct(CacheService $cacheService)
27
    {
28
        $this->cacheService = $cacheService;
29
    }
30
31
    /**
32
     * Clear items from the cache
33
     *
34
     * @return string
35
     */
36
    public function clearAction()
37
    {
38
        $tags = $this->params('tags', null);
39
        if (null === $tags) {
40
            $this->console->writeLine('You should provide tags');
41
            return;
42
        }
43
44
        $tags   = explode(',', $tags);
45
        $result = false;
46
        try {
47
            $result = $this->getCacheService()->clearByTags($tags);
48
        } catch (UnsupportedAdapterException $exception) {
49
            $this->console->writeLine($exception->getMessage());
50
        }
51
52
        $this->console->writeLine(
53
            sprintf(
54
                'Cache invalidation %s',
55
                $result ? 'succeeded' : 'failed'
56
            )
57
        );
58
    }
59
60
    /**
61
     * Get the cache service
62
     *
63
     * @return CacheService
64
     */
65
    public function getCacheService()
66
    {
67
        return $this->cacheService;
68
    }
69
}
70