EventTrait::name()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace EventIO\InterOp;
3
4
/**
5
 * Trait EventTrait
6
 * @package EventIO\InterOp
7
 */
8
trait EventTrait
9
{
10
    /**
11
     * @var string
12
     */
13
    private $name;
14
15
    /**
16
     * @var boolean
17
     */
18
    private $propagationStopped = false;
19
20
    /**
21
     * The name of the event
22
     * @return string
23
     */
24
    public function name()
25
    {
26
        return $this->name;
27
    }
28
29
    /**
30
     * Check whether propagation was stopped.
31
     *
32
     * @return bool
33
     */
34
    public function isPropagationStopped(): bool
35
    {
36
        return ($this->propagationStopped);
37
    }
38
39
    /**
40
     * @return self
41
     */
42
    public function stopPropagation(): self
43
    {
44
        $this->propagationStopped = true;
45
46
        return $this;
47
    }
48
}
49