MindBoxRequest::getDeviceUUID()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 1
c 2
b 0
f 0
dl 0
loc 3
ccs 1
cts 1
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
4
namespace floor12\MindBox;
5
6
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
60
    {
61 2
        $this->body = $body;
62
    }
63 2
64
65
}
66