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

EvaluateRequest::getBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
crap 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