MindBoxRequest   A
last analyzed

Complexity

Total Complexity 10

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 10
eloc 15
c 2
b 0
f 0
dl 0
loc 55
ccs 11
cts 11
cp 1
rs 10

10 Methods

Rating   Name   Duplication   Size   Complexity  
A setBody() 0 3 1
A getBodyAsJson() 0 3 1
A getDeviceUUID() 0 3 1
A isAsync() 0 3 1
A getMode() 0 3 1
A getOperationName() 0 3 1
A setDeviceUUID() 0 3 1
A setMode() 0 3 1
A setOperationName() 0 3 1
A getBody() 0 3 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