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

CallRequest   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 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