Completed
Pull Request — master (#35)
by David
04:36
created

Symfony2EventDispatcherSubscriber   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 0
loc 23
ccs 0
cts 8
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A handle() 0 4 1
1
<?php
2
3
namespace Rawkode\Eidetic\EventStore\Symfony2EventDispatcherSubscriber;
4
5
use Rawkode\Eidetic\EventStore\EventStore;
6
use Rawkode\Eidetic\EventStore\EventSubscriber;
7
8
use Symfony\Component\EventDispatcher\EventDispatcher;
9
10
final class Symfony2EventDispatcherSubscriber implements EventSubscriber
11
{
12
    /**
13
     * @var EventDispatcher
14
     */
15
    private $eventDispatcher;
16
17
    /**
18
     */
19
    public function __construct(EventDispatcher $eventDispatcher)
20
    {
21
        $this->eventDispatcher = $eventDispatcher;
22
    }
23
24
    /**
25
     * @param  int $eventHook
26
     * @param  object $event
27
     */
28
    public function handle($eventHook, $event)
29
    {
30
        $this->eventDispatcher->dispatch($eventHook, new EventDispatcherEvent($event));
31
    }
32
}
33