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

CallRequest::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
3
namespace Tarantool\Client\Request;
4
5
use Tarantool\Client\IProto;
6
7
class CallRequest implements Request
8
{
9
    private $funcName;
10
    private $args;
11
12 7
    public function __construct($funcName, array $args = [])
13
    {
14 7
        $this->funcName = $funcName;
15 7
        $this->args = $args;
16 7
    }
17
18 5
    public function getType()
19
    {
20 5
        return self::TYPE_CALL;
21
    }
22
23 5
    public function getBody()
24
    {
25
        return [
26 5
            IProto::FUNCTION_NAME => $this->funcName,
27 5
            IProto::TUPLE => $this->args,
28
        ];
29
    }
30
}
31