DispatcherAwareTrait::setDispatcher()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4286
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: arnaud
5
 * Date: 04/11/15
6
 * Time: 20:17
7
 */
8
9
namespace Ndrx\Profiler\Events;
10
11
use Symfony\Component\EventDispatcher\EventDispatcher;
12
13
trait DispatcherAwareTrait
14
{
15
    /**
16
     * @var EventDispatcher
17
     */
18
    protected $dispatcher;
19
20
    /**
21
     * @return EventDispatcher
22
     */
23 130
    public function getDispatcher()
24
    {
25 130
        return $this->dispatcher;
26
    }
27
28
    /**
29
     * @param EventDispatcher $eventDispatcher
30
     * @return $this
31
     */
32 102
    public function setDispatcher(EventDispatcher $eventDispatcher)
33
    {
34 102
        $this->dispatcher = $eventDispatcher;
35
36 102
        return $this;
37
    }
38
}
39