| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | class EventSubscriptionQueryValue implements \Serializable |
||
| 6 | { |
||
| 7 | protected $eventType; |
||
| 8 | protected $eventName; |
||
| 9 | |||
| 10 | public function __construct(string $eventName, string $eventType) |
||
| 11 | { |
||
| 12 | $this->eventName = $eventName; |
||
| 13 | $this->eventType = $eventType; |
||
| 14 | } |
||
| 15 | |||
| 16 | public function serialize() |
||
| 17 | { |
||
| 18 | return json_encode([ |
||
| 19 | 'eventName' => $this->eventName, |
||
| 20 | 'eventType' => $this->eventType |
||
| 21 | ]); |
||
| 22 | } |
||
| 23 | |||
| 24 | public function unserialize($data) |
||
| 25 | { |
||
| 26 | $json = json_decode($data); |
||
| 27 | $this->eventName = $json->eventName; |
||
| 28 | $this->eventType = $json->eventType; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getEventType(): string |
||
| 34 | } |
||
| 35 | |||
| 36 | public function setEventType(string $eventType): void |
||
| 37 | { |
||
| 38 | $this->eventType = $eventType; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function getEventName(): string |
||
| 42 | { |
||
| 43 | return $this->eventName; |
||
| 44 | } |
||
| 45 | |||
| 46 | public function setEventName(string $eventName): void |
||
| 49 | } |
||
| 50 | } |
||
| 51 |