public function jsonSerialize(): stdClass
    {
        $object = (object)object_get_properties($this, $this instanceof DynamicEntity);

        /** @var Event\ToJson $event */
        $event = $this->dispatchEvent(new Event\ToJson($this, $object));
        $data = i\type_check($event->getPayload(), stdClass::class, new UnexpectedValueException());

        return $data;
    }