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.

Controller::shouldCache()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 6
nc 2
nop 1
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\Strategy;
9
10
use Zend\Mvc\MvcEvent;
11
12
class Controller extends AbstractStrategy
13
{
14
    /**
15
     * @var array
16
     */
17
    protected $controllers;
18
19
    /**
20
     * {@inheritDoc}
21
     */
22
    public function shouldCache(MvcEvent $event)
23
    {
24
        $routeMatch = $event->getRouteMatch();
25
26
        if (null === $routeMatch) {
27
            return false;
28
        }
29
30
        $controller = $routeMatch->getParam('controller');
31
32
        return in_array($controller, $this->getControllers());
33
    }
34
35
    /**
36
     * @return array
37
     */
38
    public function getControllers()
39
    {
40
        return $this->controllers;
41
    }
42
43
    /**
44
     * @param array $controllers
45
     * @return $this
46
     */
47
    public function setControllers(array $controllers)
48
    {
49
        $this->controllers = $controllers;
50
        return $this;
51
    }
52
}
53