From 7b44cbe272e6adf24109a9232a48008a8818f318 Mon Sep 17 00:00:00 2001 From: Evgeny Zinoviev Date: Mon, 1 Mar 2021 02:03:07 +0300 Subject: support new protocol --- src/RequestMessage.php | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/RequestMessage.php') diff --git a/src/RequestMessage.php b/src/RequestMessage.php index 85b9786..dc28e4d 100644 --- a/src/RequestMessage.php +++ b/src/RequestMessage.php @@ -4,6 +4,7 @@ namespace jobd; class RequestMessage extends Message { + protected $requestNo; protected $requestType; protected $requestData; protected $password; @@ -27,13 +28,28 @@ class RequestMessage extends Message { $this->password = $password; } + /** + * @param int $no + */ + public function setRequestNo(int $no) { + $this->requestNo = $no; + } + /** * @return string[] */ protected function getContent(): array { - $request = ['type' => $this->requestType]; + $request = [ + 'type' => $this->requestType, + 'no' => $this->requestNo, + ]; + if (!is_null($this->requestData)) $request['data'] = $this->requestData; + + if (!is_null($this->password)) + $request['password'] = $this->password; + return $request; } -- cgit v1.2.3