Completed
Push — master ( 948520...165aa8 )
by Aurimas
14:17
created

Event::getParams()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Thruster\Component\EventEmitter;
4
5
/**
6
 * Class Event
7
 *
8
 * @package Thruster\Component\EventEmitter
9
 * @author  Aurimas Niekis <[email protected]>
10
 */
11
class Event implements EventInterface
12
{
13
    /**
14
     * @var bool Whether no further event listeners should be triggered
15
     */
16
    protected $propagationStopped;
17
18
    /**
19
     * @var array
20
     */
21
    protected $params;
22
23
    /**
24
     * @param array $params
25
     */
26 13
    public function __construct(array $params = [])
27
    {
28 13
        $this->propagationStopped = false;
29
30 13
        $this->params = $params;
31 13
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    public function isPropagationStopped() : bool
37
    {
38 1
        return $this->propagationStopped;
39
    }
40
41
    /**
42
     * {@inheritdoc}
43
     */
44 9
    public function stopPropagation()
45
    {
46 9
        $this->propagationStopped = true;
47 9
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52 4
    public function getParams() : array
53
    {
54 4
        return $this->params;
55
    }
56
}
57