Completed
Push — master ( aa3135...09344c )
by Pierre
121:26 queued 118:18
created

EventAbstract::getEventName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
dl 0
loc 3
ccs 0
cts 2
cp 0
crap 2
rs 10
c 1
b 0
f 0
eloc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Component\Pubsub;
4
5
class EventAbstract implements EventInterface
6
{
7
    /**
8
     * The name of the resource publishing this event
9
     * @var string
10
     */
11
    public $resourceName;
12
13
    /**
14
     * The name of this event
15
     * @var string
16
     */
17
    public $eventName;
18
19
    /**
20
     * Any data associated with this event
21
     * @var mixed
22
     */
23
    public $data;
24
25
    /**
26
     * @param string $resourceName  name of the publisher
27
     * @param string $eventName     name of the event
28
     * @param mixed $data           [OPTIONAL] Additional event data
29
     */
30
    public function __construct(
31
        string $resourceName,
32
        string $eventName,
33
        $data = null
34
    ) {
35
        $this->resourceName = $resourceName;
36
        $this->eventName = $eventName;
37
        $this->data = $data;
38
    }
39
40
    /**
41
     * return the name of the event
42
     *
43
     * @return string
44
     */
45
    public function getEventName(): string
46
    {
47
        return $this->eventName;
48
    }
49
50
    /**
51
     * return the name of the resource
52
     *
53
     * @return string
54
     */
55
    public function getResourceName(): string
56
    {
57
        return $this->resourceName;
58
    }
59
}
60