Total Complexity | 4 |
Total Lines | 63 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | class EventAbstract implements EventInterface |
||
6 | { |
||
7 | /** |
||
8 | * The name of the resource publishing this event |
||
9 | * @var string |
||
10 | */ |
||
11 | protected $resourceName; |
||
12 | |||
13 | /** |
||
14 | * The name of this event |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $eventName; |
||
18 | |||
19 | /** |
||
20 | * Any data associated with this event |
||
21 | * @var mixed |
||
22 | */ |
||
23 | protected $datas; |
||
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 | 4 | public function __construct( |
|
31 | string $resourceName, |
||
32 | string $eventName, |
||
33 | $datas = null |
||
34 | ) { |
||
35 | 4 | $this->resourceName = $resourceName; |
|
36 | 4 | $this->eventName = $eventName; |
|
37 | 4 | $this->datas = $datas; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * return the name of the event |
||
42 | * |
||
43 | * @return string |
||
44 | */ |
||
45 | 1 | public function getEventName(): string |
|
46 | { |
||
47 | 1 | return $this->eventName; |
|
48 | } |
||
49 | |||
50 | /** |
||
51 | * return the name of the resource |
||
52 | * |
||
53 | * @return string |
||
54 | */ |
||
55 | 1 | public function getResourceName(): string |
|
56 | { |
||
57 | 1 | return $this->resourceName; |
|
58 | } |
||
59 | |||
60 | /** |
||
61 | * return datas |
||
62 | * |
||
63 | * @return mixed |
||
64 | */ |
||
65 | 1 | public function getDatas() |
|
68 | } |
||
69 | } |
||
70 |