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

DeleteRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

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 DeleteRequest implements Request
8
{
9
    private $spaceId;
10
    private $indexId;
11
    private $key;
12
13 4
    public function __construct($spaceId, $indexId, array $key)
14
    {
15 4
        $this->spaceId = $spaceId;
16 4
        $this->indexId = $indexId;
17 4
        $this->key = $key;
18 4
    }
19
20 4
    public function getType()
21
    {
22 4
        return self::TYPE_DELETE;
23
    }
24
25 4
    public function getBody()
26
    {
27
        return [
28 4
            IProto::SPACE_ID => $this->spaceId,
29 4
            IProto::INDEX_ID => $this->indexId,
30 4
            IProto::KEY => $this->key,
31
        ];
32
    }
33
}
34