Total Complexity | 10 |
Total Lines | 55 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class MindBoxRequest |
||
8 | { |
||
9 | protected string $operationName; |
||
10 | protected array|null $body = null; |
||
11 | protected $deviceUUID; |
||
12 | protected $mode = MindBoxClient::MODE_SYNCHRONOUS; |
||
13 | |||
14 | public function getOperationName(): string |
||
15 | { |
||
16 | return $this->operationName; |
||
17 | } |
||
18 | |||
19 | public function getDeviceUUID(): ?string |
||
20 | { |
||
21 | 2 | return $this->deviceUUID; |
|
22 | } |
||
23 | 2 | ||
24 | public function getBody(): ?array |
||
25 | { |
||
26 | return $this->body; |
||
27 | } |
||
28 | |||
29 | 2 | public function getBodyAsJson(): string |
|
30 | { |
||
31 | 2 | return json_encode($this->body); |
|
32 | } |
||
33 | |||
34 | public function getMode(): int |
||
35 | { |
||
36 | return $this->mode; |
||
37 | 2 | } |
|
38 | |||
39 | 2 | public function isAsync(): bool |
|
40 | { |
||
41 | return $this->mode === MindBoxClient::MODE_ASYNCHRONOUS; |
||
42 | } |
||
43 | |||
44 | public function setDeviceUUID(?string $deviceUUID): void |
||
45 | 2 | { |
|
46 | $this->deviceUUID = $deviceUUID; |
||
47 | 2 | } |
|
48 | |||
49 | public function setMode(int $mode): void |
||
50 | { |
||
51 | $this->mode = $mode; |
||
52 | } |
||
53 | 1 | ||
54 | public function setOperationName($operationName): void |
||
55 | 1 | { |
|
56 | $this->operationName = $operationName; |
||
57 | } |
||
58 | |||
59 | public function setBody(array $body): void |
||
62 | } |
||
63 | 2 | ||
64 | |||
65 | } |
||
66 |