Total Complexity | 10 |
Total Lines | 106 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
9 | class Event implements EventInterface |
||
10 | { |
||
11 | /** |
||
12 | * @var string |
||
13 | */ |
||
14 | protected $name; |
||
15 | |||
16 | /** |
||
17 | * @var object |
||
18 | */ |
||
19 | protected $payload; |
||
20 | |||
21 | /** |
||
22 | * @var string[] |
||
23 | */ |
||
24 | protected $metaProperties; |
||
25 | |||
26 | public function __construct() |
||
27 | { |
||
28 | $this->metaProperties = []; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * @return string |
||
33 | */ |
||
34 | public function getName(): string |
||
35 | { |
||
36 | return $this->name; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * @param string $name |
||
41 | * |
||
42 | * @return \Jellyfish\Event\EventInterface |
||
43 | */ |
||
44 | public function setName(string $name): EventInterface |
||
45 | { |
||
46 | $this->name = $name; |
||
47 | |||
48 | return $this; |
||
49 | } |
||
50 | |||
51 | /** |
||
52 | * @return object |
||
53 | */ |
||
54 | public function getPayload(): object |
||
55 | { |
||
56 | return $this->payload; |
||
57 | } |
||
58 | |||
59 | /** |
||
60 | * @param object $payload |
||
61 | * |
||
62 | * @return \Jellyfish\Event\EventInterface |
||
63 | */ |
||
64 | public function setPayload(object $payload): EventInterface |
||
65 | { |
||
66 | $this->payload = $payload; |
||
67 | |||
68 | return $this; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @return string[] |
||
73 | */ |
||
74 | public function getMetaProperties(): array |
||
75 | { |
||
76 | return $this->metaProperties; |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * @param string[] $metaProperties |
||
81 | * |
||
82 | * @return \Jellyfish\Event\EventInterface |
||
83 | */ |
||
84 | public function setMetaProperties(array $metaProperties): EventInterface |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * @param string $key |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getMetaProperty(string $key): ?string |
||
102 | } |
||
103 | |||
104 | /** |
||
105 | * @param string $key |
||
106 | * @param string $metaProperty |
||
107 | * |
||
108 | * @return \Jellyfish\Event\EventInterface |
||
109 | */ |
||
110 | public function setMetaProperty(string $key, string $metaProperty): EventInterface |
||
115 | } |
||
116 | } |
||
117 |