aboutsummaryrefslogtreecommitdiff
path: root/src/RequestMessage.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-03-01 02:03:07 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-03-01 02:03:07 +0300
commit7b44cbe272e6adf24109a9232a48008a8818f318 (patch)
tree7725bca8517082fe79fe31af1edfca95dfc76987 /src/RequestMessage.php
parentc66fc2f691424023b107dfee1295fa165b223f86 (diff)
support new protocol
Diffstat (limited to 'src/RequestMessage.php')
-rw-r--r--src/RequestMessage.php18
1 files changed, 17 insertions, 1 deletions
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;
@@ -28,12 +29,27 @@ class RequestMessage extends Message {
}
/**
+ * @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;
}