data = $data; $this->code = $code ?: ResultCode::UNKNOWN['code']; $this->message = $message ?: ResultCode::UNKNOWN['msg']; parent::__construct($this->message, $this->code, $previous); } /** * 获取附加数据 * @return array */ public function getData(): array { return $this->data; } }