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   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 3
dl 0
loc 41
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A shouldCache() 0 12 2
A getControllers() 0 4 1
A setControllers() 0 5 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