addType('session_id', Types::INTEGER); $this->addType('role', Types::STRING); $this->addType('content', Types::STRING); $this->addType('timestamp', Types::INTEGER); $this->addType('ocp_task_id', Types::INTEGER); $this->addType('sources', Types::STRING); $this->addType('attachments', Types::STRING); } #[\ReturnTypeWillChange] public function jsonSerialize() { return [ 'id' => $this->id, 'session_id' => $this->sessionId, 'role' => $this->role, 'content' => $this->content, 'timestamp' => $this->timestamp, 'ocp_task_id' => $this->ocpTaskId, 'sources' => $this->sources, 'attachments' => $this->attachments === null ? [] : (json_decode($this->attachments, true) ?: []), ]; } }