errorCode; } public function getHttpCode(): int { return $this->getCode(); } /** * @return array */ abstract public function getAdditionalData(): array; public function jsonSerialize(): array { return [ "errcode" => $this->getErrorCode(), "error" => $this->getMessage(), ...$this->getAdditionalData(), ]; } }