Completed
Push — master ( d06bab...02e31a )
by Eugene
03:46
created

SubscribeRequest::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Tarantool\Client\Request;
4
5
use Tarantool\Client\IProto;
6
7
class SubscribeRequest implements Request
8
{
9
    private $clusterUuid;
10
    private $serverUuid;
11
    private $vclock;
12
13
    public function __construct($clusterUuid, $serverUuid, array $vclock)
14
    {
15
        $this->clusterUuid = $clusterUuid;
16
        $this->serverUuid = $serverUuid;
17
        $this->vclock = $vclock;
18
    }
19
20
    public function getType()
21
    {
22
        return self::TYPE_SUBSCRIBE;
23
    }
24
25
    public function getBody()
26
    {
27
        return [
28
            IProto::CLUSTER_UUID => $this->clusterUuid,
29
            IProto::SERVER_UUID => $this->serverUuid,
30
            IProto::VCLOCK => $this->vclock,
31
        ];
32
    }
33
}
34