Completed
Push — master ( bdd70c...0550f6 )
by Eugene
10:03
created

UpsertRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 29
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 UpsertRequest implements Request
8
{
9
10
    private $spaceId;
11
    private $values;
12
    private $operations;
13
14
    public function __construct($spaceId, $values, $operations)
15
    {
16
        $this->spaceId = $spaceId;
17
        $this->values = $values;
18
        $this->operations = $operations;
19
    }
20
21
    public function getType()
22
    {
23
        return self::TYPE_UPSERT;
24
    }
25
26
    public function getBody()
27
    {
28
        return [
29
            IProto::SPACE_ID => $this->spaceId,
30
            IProto::TUPLE => $this->values,
31
            IProto::OPERATIONS => $this->operations,
32
        ];
33
    }
34
35
}