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

ApiTransactionTrait::multi()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
ccs 0
cts 3
cp 0
rs 9.4285
nc 1
cc 1
eloc 3
nop 0
crap 2
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 ApiTransactionTrait
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 discard()
22
    {
23
        // TODO: Implement discard() method.
24
        $command = Enum::DISCARD;
25
26
        return $this->dispatch(Builder::build($command));
27
    }
28
29
    /**
30
     * @override
31
     * @inheritDoc
32
     */
33
    public function multi()
34
    {
35
        // TODO: Implement multi() method.
36
        $command = Enum::MULTI;
37
38
        return $this->dispatch(Builder::build($command));
39
    }
40
41
    /**
42
     * @override
43
     * @inheritDoc
44
     */
45
    public function unWatch()
46
    {
47
        // TODO: Implement unWatch() method.
48
        $command = Enum::UNWATCH;
49
50
        return $this->dispatch(Builder::build($command));
51
    }
52
53
    /**
54
     * @override
55
     * @inheritDoc
56
     */
57
    public function watch($key, ...$keys)
58
    {
59
        // TODO: Implement watch() method.
60
        $command = Enum::WATCH;
61
        $args = [$key];
62
        $args = array_merge($args, $keys);
63
64
        return $this->dispatch(Builder::build($command, $args));
65
    }
66
}
67