Completed
Push — master ( ee960b...879158 )
by David
02:05
created

Symfony2EventDispatcherSubscriber::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
cc 1
eloc 2
nc 1
nop 2
crap 2
1
<?php
2
3
namespace Rawkode\Eidetic\EventStore\Symfony2EventDispatcherSubscriber;
4
5
use Rawkode\Eidetic\EventStore\EventStore;
6
use Rawkode\Eidetic\EventStore\EventSubscriber;
7
use Symfony\Component\EventDispatcher\EventDispatcher;
8
9
final class Symfony2EventDispatcherSubscriber implements EventSubscriber
10
{
11
    /**
12
     * @var EventDispatcher
13
     */
14
    private $eventDispatcher;
15
16
    /**
17
     */
18
    public function __construct(EventDispatcher $eventDispatcher)
19
    {
20
        $this->eventDispatcher = $eventDispatcher;
21
    }
22
23
    /**
24
     * @param  int $eventHook
25
     * @param  object $event
26
     */
27
    public function handle($eventHook, $event)
28
    {
29
        $this->eventDispatcher->dispatch($eventHook, new EventDispatcherEvent($event));
30
    }
31
}
32