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

UpdateRequest::getType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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