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

EventAbstract   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 53
ccs 0
cts 8
cp 0
rs 10
c 1
b 0
f 0
eloc 9
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getEventName() 0 3 1
A __construct() 0 8 1
A getResourceName() 0 3 1
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