EventDispatcher   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Test Coverage

Coverage 62.5%

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 19
ccs 5
cts 8
cp 0.625
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A dispatch() 0 3 1
A addSubscriber() 0 5 1
A addListener() 0 5 1
1
<?php
2
3
namespace Vox\Webservice;
4
5
use Doctrine\Common\EventManager;
6
7
class EventDispatcher extends EventManager implements EventDispatcherInterface
8
{
9 1
    public function addListener($event, $listener)
10
    {
11 1
        $this->addEventListener($event, $listener);
12
        
13 1
        return $this;
14
    }
15
16
    public function addSubscriber($subscriber)
17
    {
18
        $this->addEventSubscriber($subscriber);
19
        
20
        return $this;
21
    }
22
23 2
    public function dispatch(string $event, $context)
24
    {
25 2
        $this->dispatchEvent($event, $context);
26 2
    }
27
}
28