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

SelectRequest::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 SelectRequest implements Request
8
{
9
    private $spaceId;
10
    private $indexId;
11
    private $key;
12
    private $offset;
13
    private $limit;
14
    private $iterator;
15
16 32
    public function __construct($spaceId, $indexId, array $key, $offset, $limit, $iterator)
17
    {
18 32
        $this->spaceId = $spaceId;
19 32
        $this->indexId = $indexId;
20 32
        $this->key = $key;
21 32
        $this->offset = $offset;
22 32
        $this->limit = $limit;
23 32
        $this->iterator = $iterator;
24 32
    }
25
26 32
    public function getType()
27
    {
28 32
        return self::TYPE_SELECT;
29
    }
30
31 32
    public function getBody()
32
    {
33
        return [
34 32
            IProto::KEY => $this->key,
35 32
            IProto::SPACE_ID => $this->spaceId,
36 32
            IProto::INDEX_ID => $this->indexId,
37 32
            IProto::LIMIT => $this->limit,
38 32
            IProto::OFFSET => $this->offset,
39 32
            IProto::ITERATOR => $this->iterator,
40
        ];
41
    }
42
}
43