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

SubscribeRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 27
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getType() 0 4 1
A getBody() 0 8 1
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