requestData = $request_data; $this->requestType = $request_type; } /** * @param string $password */ public function setPassword(string $password) { $this->password = $password; } /** * @param int $no */ public function setRequestNo(int $no) { $this->requestNo = $no; } /** * @return string[] */ protected function getContent(): array { $request = [ 'type' => $this->requestType, 'no' => $this->requestNo, ]; if (!is_null($this->requestData)) $request['data'] = (object)$this->requestData; if (!is_null($this->password)) $request['password'] = $this->password; return $request; } }