@@ 66-78 (lines=13) @@ | ||
63 | ]; |
|
64 | } |
|
65 | ||
66 | private function setPayload(DomainEvent $event) : void |
|
67 | { |
|
68 | $this->payload = []; |
|
69 | $eventReflection = new \ReflectionClass($event); |
|
70 | foreach ($eventReflection->getProperties() as $property) { |
|
71 | if ('occurredOn' === $property->getName()) { |
|
72 | continue; |
|
73 | } |
|
74 | $property->setAccessible(true); |
|
75 | $this->payload[$property->getName()] = $this->serializePayload($property, $event); |
|
76 | } |
|
77 | $this->payload = json_encode($this->payload); |
|
78 | } |
|
79 | ||
80 | private function setSerializedEvent(DomainEvent $event) : void |
|
81 | { |
|
@@ 80-93 (lines=14) @@ | ||
77 | $this->payload = json_encode($this->payload); |
|
78 | } |
|
79 | ||
80 | private function setSerializedEvent(DomainEvent $event) : void |
|
81 | { |
|
82 | $this->serializedEvent = []; |
|
83 | $eventReflection = new \ReflectionClass($event); |
|
84 | foreach ($eventReflection->getProperties() as $property) { |
|
85 | if ('occurredOn' === $property->getName()) { |
|
86 | continue; |
|
87 | } |
|
88 | $property->setAccessible(true); |
|
89 | $this->serializedEvent[$property->getName()] = $this->serializeEvent($property, $event); |
|
90 | } |
|
91 | ||
92 | $this->serializedEvent = json_encode($this->serializedEvent); |
|
93 | } |
|
94 | ||
95 | private function setOccurredOn(\DateTimeInterface $occurredOn) : void |
|
96 | { |