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.

EventProvider   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 38
rs 10
c 0
b 0
f 0
ccs 9
cts 9
cp 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A setEventManager() 0 8 1
A getEventManager() 0 8 2
1
<?php
2
namespace HtImgModule\EventManager;
3
4
use Zend\EventManager\EventManagerAwareInterface;
5
use Zend\EventManager\EventManagerInterface;
6
use Zend\EventManager\EventManager;
7
8
abstract class EventProvider implements EventManagerAwareInterface
9
{
10
    /**
11
     * @var EventManagerInterface
12
     */
13
    protected $events;
14
15
    /**
16
     * Set the event manager instance used by this context
17
     *
18
     * @param  EventManagerInterface $events
19
     * @return mixed
20
     */
21 2
    public function setEventManager(EventManagerInterface $events)
22
    {
23 2
        $identifiers = array(__CLASS__, get_called_class());
24 2
        $events->setIdentifiers($identifiers);
25 2
        $this->events = $events;
26
27 2
        return $this;
28
    }
29
30
    /**
31
     * Retrieve the event manager
32
     *
33
     * Lazy-loads an EventManager instance if none registered.
34
     *
35
     * @return EventManagerInterface
36
     */
37 2
    public function getEventManager()
38
    {
39 2
        if (!$this->events instanceof EventManagerInterface) {
40 2
            $this->setEventManager(new EventManager());
41
        }
42
43 2
        return $this->events;
44
    }
45
}
46