Completed
Push — master ( 9e125a...9a1e57 )
by Kamil
02:25
created

ApiHyperLogTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

4 Methods

Rating   Name   Duplication   Size   Complexity  
dispatch() 0 1 ?
A pFAdd() 0 9 1
A pFCount() 0 8 1
A pFMerge() 0 8 1
1
<?php
2
3
namespace Dazzle\Redis\Command\Compose;
4
5
use Dazzle\Redis\Command\Builder;
6
use Dazzle\Redis\Command\Enum;
7
use Dazzle\Redis\Driver\Request;
8
9
trait ApiHyperLogTrait
10
{
11
    /**
12
     * @param Request $request
13
     * @return mixed
14
     */
15
    abstract function dispatch(Request $request);
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
16
17
    /**
18
     * @override
19
     * @inheritDoc
20
     */
21
    public function pFAdd($key, ...$elements)
22
    {
23
        // TODO: Implement pFAdd() method.
24
        $command = Enum::PFADD;
25
        $args = [$key];
26
        $args = array_merge($args, $elements);
27
28
        return $this->dispatch(Builder::build($command, $args));
29
    }
30
31
    /**
32
     * @override
33
     * @inheritDoc
34
     */
35
    public function pFCount(...$keys)
36
    {
37
        // TODO: Implement pFCount() method.
38
        $command = Enum::PFCOUNT;
39
        $args = $keys;
40
41
        return $this->dispatch(Builder::build($command, $args));
42
    }
43
44
    /**
45
     * @override
46
     * @inheritDoc
47
     */
48
    public function pFMerge(array $dsKeyMap)
49
    {
50
        // TODO: Implement pFMerge() method.
51
        $command = Enum::PFMERGE;
52
        $args = $dsKeyMap;
53
54
        return $this->dispatch(Builder::build($command, $args));
55
    }
56
}
57