Completed
Pull Request — master (#9)
by Eugene
09:13
created

ClientAdapter   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A call() 0 6 2
1
<?php
2
3
/*
4
 * This file is part of the Tarantool Queue package.
5
 *
6
 * (c) Eugene Leonovich <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Tarantool\Queue;
13
14
use Tarantool\Client\Client;
15
16
class ClientAdapter
17
{
18
    private $client;
19
20 160
    public function __construct(Client $client)
21
    {
22 160
        $this->client = $client;
23 160
    }
24
25 160
    public function call($funcName, array $args = [])
26
    {
27 160
        $result = $this->client->call($funcName, $args);
28
29 136
        return isset($result->getData()[0][0]) ? $result->getData() : [$result->getData()];
30
    }
31
}
32