addType('id', 'integer'); $this->addType('version', 'integer'); $this->addType('documentId', 'integer'); $this->addType('sessionId', 'integer'); $this->addType('timestamp', 'integer'); } public function jsonSerialize(): array { $jsonData = \json_decode($this->data, false); if (\json_last_error() !== JSON_ERROR_NONE) { throw new \InvalidArgumentException('Failed to parse step data'); } $version = $this->getVersion() === self::VERSION_STORED_IN_ID ? $this->getId() : $this->getVersion(); return [ 'id' => $this->getId(), 'data' => $jsonData, 'version' => $version, 'sessionId' => $this->getSessionId(), 'timestamp' => $this->getTimestamp(), ]; } }