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