Passed
Push — master ( 9cb37e...3ceb50 )
by Dmitry
01:15
created

Client::remove()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace SymfonyBundles\RedisBundle\Redis;
4
5
class Client extends \Predis\Client implements ClientInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10 1
    public function push(string $key, ...$values): int
11
    {
12 1
        return $this->call('rpush', array_merge([$key], $values));
13
    }
14
15
    /**
16
     * {@inheritdoc}
17
     */
18 1
    public function count(string $key): int
19
    {
20 1
        return $this->call('llen', [$key]);
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26 1
    public function remove(string $key): int
27
    {
28 1
        return $this->call('del', [$key]);
29
    }
30
31
    /**
32
     * Creates a Redis command with the specified arguments and sends a request to the server.
33
     *
34
     * @param string $command   the command ID
35
     * @param array  $arguments the arguments for the command
36
     *
37
     * @return mixed
38
     */
39 1
    protected function call($command, array $arguments = [])
40
    {
41 1
        return $this->executeCommand($this->createCommand($command, $arguments));
42
    }
43
}
44