public function serialize(DomainEvent $event): string {
        $reflect = new ReflectionObject($event);
        $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PRIVATE);

        return json_encode([
            'eventName' => $this->eventNameForClass(get_class($event)),
            'fields'    => $this->serializeFields($props, $event),
        ]);
    }
public function serialize(DomainEvent $event): string {
        $reflect = new ReflectionObject($event);
        $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC | ReflectionProperty::IS_PRIVATE);

        return json_encode([
            'eventName' => $this->eventNameForClass(get_class($event)),
            'fields'    => $this->serializeFields($props, $event),
        ]);
    }
public function serialize ( DomainEvent $ event ) : string { $ reflect = new ReflectionObject ( $ event ) ; $ props = $ reflect -> getProperties ( ReflectionProperty :: IS_PUBLIC | ReflectionProperty :: IS_PRIVATE ) ; return json_encode ( [ 'eventName' => $ this -> eventNameForClass ( get_class ( $ event ) ) , 'fields' => $ this -> serializeFields ( $ props , $ event ) , ] ) ; }
serialize a domain event into event sourcery library
storage conventions
@param DomainEvent $event
@return string
serialize a domain event into event sourcery library storage conventions