requestNo = $request_no; $this->error = $error; $this->data = $data; } /** * @return array */ protected function getContent(): array { $response = [ 'no' => $this->requestNo ]; if (!is_null($this->error)) $response['error'] = $this->error; if (!is_null(!$this->data)) $response['data'] = $this->data; return $response; } /** * @return mixed */ public function getError() { return $this->error; } /** * @return mixed */ public function getData() { return $this->data; } /** * @return int */ public function getRequestNo(): int { return $this->requestNo; } }