Completed
Push — master ( b586f8...cd674c )
by Kamil
12s
created

ApiClusterTrait::readWrite()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 3
cts 3
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 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 ApiClusterTrait
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 clusterAddSlots(...$slots)
22
    {
23
        // TODO: Implement clusterAddSlots() method.
24
        $command = Enum::CLUSTER_ADDSLOTS;
25
        $args = $slots;
26
27
        return $this->dispatch(Builder::build($command, $args));
28
    }
29
30
    /**
31
     * @override
32
     * @inheritDoc
33
     */
34
    public function clusterCountFailureReports($nodeId)
35
    {
36
        // TODO: Implement clusterCountFailureReports() method.
37
        $command = Enum::CLUSTER_COUNT_FAILURE_REPORTS;
38
        $args = [$nodeId];
39
40
        return $this->dispatch(Builder::build($command, $args));
41
    }
42
43
    /**
44
     * @override
45
     * @inheritDoc
46
     */
47
    public function clusterCountKeysInSlot($slot)
48
    {
49
        // TODO: Implement clusterCountKeysInSlot() method.
50
        $command = Enum::CLUSTER_COUNTKEYSINSLOT;
51
        $args = $slot;
52
53
        return $this->dispatch(Builder::build($command, $args));
54
    }
55
56
    /**
57
     * @override
58
     * @inheritDoc
59
     */
60
    public function clusterDelSlots(...$slots)
61
    {
62
        // TODO: Implement clusterDelSlots() method.
63
        $command = Enum::CLUSTER_DELSLOTS;
64
        $args = $slots;
65
66
        return $this->dispatch(Builder::build($command, $args));
67
    }
68
69
    /**
70
     * @override
71
     * @inheritDoc
72
     */
73
    public function clusterFailOver($operation)
0 ignored issues
show
Unused Code introduced by
The parameter $operation is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
74
    {
75
        // TODO: Implement clusterFailOver() method.
76
    }
77
78
    /**
79
     * @override
80
     * @inheritDoc
81
     */
82
    public function clusterForget($nodeId)
0 ignored issues
show
Unused Code introduced by
The parameter $nodeId is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
83
    {
84
        // TODO: Implement clusterForget() method.
85
    }
86
87
    /**
88
     * @override
89
     * @inheritDoc
90
     */
91
    public function clusterGetKeyInSlot($slot, $count)
0 ignored issues
show
Unused Code introduced by
The parameter $slot is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $count is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
92
    {
93
        // TODO: Implement clusterGetKeyInSlot() method.
94
    }
95
96
    /**
97
     * @override
98
     * @inheritDoc
99
     */
100
    public function clusterInfo()
101
    {
102
        // TODO: Implement clusterInfo() method.
103
        $command = Enum::CLUSTER_INFO;
104
105
        return $this->dispatch(Builder::build($command));
106
    }
107
108
    /**
109
     * @override
110
     * @inheritDoc
111
     */
112 View Code Duplication
    public function clusterKeySlot($key)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
113
    {
114
        // TODO: Implement clusterKeySlot() method.
115
        $command = Enum::CLUSTER_KEYSLOT;
116
        $args = [$key];
117
118
        return $this->dispatch(Builder::build($command, $args));
119
    }
120
121
    /**
122
     * @override
123
     * @inheritDoc
124
     */
125
    public function clusterMeet($ip, $port)
126
    {
127
        // TODO: Implement clusterMeet() method.
128
        $command = Enum::CLUSTER_MEET;
129
        $args = [$ip, $port];
130
131
        return $this->dispatch(Builder::build($command, $args));
132
    }
133
134
    /**
135
     * @override
136
     * @inheritDoc
137
     */
138
    public function clusterNodes()
139
    {
140
        // TODO: Implement clusterNodes() method.
141
    }
142
143
    /**
144
     * @override
145
     * @inheritDoc
146
     */
147
    public function clusterReplicate($nodeId)
0 ignored issues
show
Unused Code introduced by
The parameter $nodeId is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
148
    {
149
        // TODO: Implement clusterReplicate() method.
150
    }
151
152
    /**
153
     * @override
154
     * @inheritDoc
155
     */
156
    public function clusterReset($mode)
0 ignored issues
show
Unused Code introduced by
The parameter $mode is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
157
    {
158
        // TODO: Implement clusterReset() method.
159
    }
160
161
    /**
162
     * @override
163
     * @inheritDoc
164
     */
165
    public function clusterSaveConfig()
166
    {
167
        // TODO: Implement clusterSaveConfig() method.
168
    }
169
170
    /**
171
     * @override
172
     * @inheritDoc
173
     */
174
    public function clusterSetConfigEpoch($configEpoch)
0 ignored issues
show
Unused Code introduced by
The parameter $configEpoch is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
175
    {
176
        // TODO: Implement clusterSetConfigEpoch() method.
177
    }
178
179
    /**
180
     * @inheritDoc
181
     */
182
    public function clusterSetSlot($command, $nodeId)
0 ignored issues
show
Unused Code introduced by
The parameter $command is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
183
    {
184
        // TODO: Implement clusterSetSlot() method.
185
        $command = Enum::CLUSTER_SETSLOT;
186
        $args = [$command, $nodeId];
187
188
        return $this->dispatch(Builder::build($command, $args));
189
    }
190
191
    /**
192
     * @override
193
     * @inheritDoc
194
     */
195
    public function clusterSlaves($nodeId)
196
    {
197
        // TODO: Implement clusterSlaves() method.
198
        $command = Enum::CLUSTER_SLAVES;
199
        $args = [$nodeId];
200
201
        return $this->dispatch(Builder::build($command, $args));
202
    }
203
204
    /**
205
     * @override
206
     * @inheritDoc
207
     */
208
    public function clusterSlots()
209
    {
210
        // TODO: Implement clusterSlots() method.
211
        $command = Enum::CLUSTER_SLOTS;
212
213
        return $this->dispatch(Builder::build($command));
214
    }
215
216
    /**
217
     * @override
218
     * @inheritDoc
219
     */
220
    public function readOnly()
221
    {
222
        // TODO: Implement readOnly() method.
223
        $command = Enum::READONLY;
224
225
        return $this->dispatch(Builder::build($command));
226
    }
227
228
    /**
229
     * @override
230
     * @inheritDoc
231
     */
232 1
    public function readWrite()
233
    {
234
        // TODO: Implement readWrite() method.
235 1
        $command = Enum::READWRITE;
236
237 1
        return $this->dispatch(Builder::build($command));
238
    }
239
}