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.

AbstractStrategy::shouldCacheCallback()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: bram
5
 * Date: 3-1-14
6
 * Time: 21:46
7
 */
8
9
namespace StrokerCache\Strategy;
10
11
use StrokerCache\Event\CacheEvent;
12
use Zend\EventManager\EventManagerInterface;
13
use Zend\EventManager\ListenerAggregateInterface;
14
use Zend\Stdlib\AbstractOptions;
15
16
abstract class AbstractStrategy extends AbstractOptions implements
17
    ListenerAggregateInterface,
18
    StrategyInterface
19
{
20
    /**
21
     * @var callable[]
22
     */
23
    protected $listeners = [];
24
25
    /**
26
     * {@inheritDoc}
27
     */
28
    public function detach(EventManagerInterface $events)
29
    {
30
        foreach ($this->listeners as $index => $callback) {
31
            $events->detach($callback);
32
            unset($this->listeners[$index]);
33
        }
34
    }
35
36
    /**
37
     * {@inheritDoc}
38
     */
39
    public function attach(EventManagerInterface $events, $listener = 1)
40
    {
41
        $this->listeners[] = $events->attach(CacheEvent::EVENT_SHOULDCACHE, [$this, 'shouldCacheCallback'], 100);
42
    }
43
44
    /**
45
     * @param  CacheEvent $event
46
     * @return bool
47
     */
48
    public function shouldCacheCallback(CacheEvent $event)
49
    {
50
        return $this->shouldCache($event->getMvcEvent());
51
    }
52
}
53