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

EvaluateRequest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getType() 0 4 1
A getBody() 0 7 1
1
<?php
2
3
namespace Tarantool\Client\Request;
4
5
use Tarantool\Client\IProto;
6
7
class EvaluateRequest implements Request
8
{
9
    private $expr;
10
    private $args;
11
12 25
    public function __construct($expr, array $args = [])
13
    {
14 25
        $this->expr = $expr;
15 25
        $this->args = $args;
16 25
    }
17
18 23
    public function getType()
19
    {
20 23
        return self::TYPE_EVALUATE;
21
    }
22
23 23
    public function getBody()
24
    {
25
        return [
26 23
            IProto::EXPR => $this->expr,
27 23
            IProto::TUPLE => $this->args,
28
        ];
29
    }
30
}
31