Completed
Push — master ( 6e0bb5...dae7dc )
by GBProd
04:09
created

Dispatcher::dispatch()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 6
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
ccs 6
cts 6
cp 1
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
namespace GBProd\DomainEventBundle\Event;
4
5
use GBProd\DomainEvent\Dispatcher as DomainEventDispatcher;
6
use GBProd\DomainEvent\DomainEvent;
7
use Symfony\Component\EventDispatcher\EventDispatcher;
8
9
/**
10
 * Domain dispatcher implementation for symfony dispatcher
11
 * 
12
 * @author gbprod <[email protected]>
13
 */
14
class Dispatcher implements DomainEventDispatcher
15
{
16
    /**
17
     * @var EventDispatcher
18
     */
19
    private $dispatcher;
20
    
21
    /**
22
     * @param EventDispatcher $dispatcher
23
     */
24 2
    public function __construct(EventDispatcher $dispatcher)
25 1
    {
26 2
        $this->dispatcher = $dispatcher;
27 2
    }
28
    
29
    /**
30
     * {@inheritdoc}
31
     */
32 1
    public function dispatch(DomainEvent $event)
33
    {
34 1
        $this->dispatcher->dispatch(
35 1
            get_class($event),
36 1
            new Event($event)
37 1
        );
38
    }
39
}