PredisDriver   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 3
c 1
b 0
f 1
lcom 1
cbo 1
dl 0
loc 31
ccs 9
cts 9
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A rPush() 0 4 1
A lPop() 0 4 1
1
<?php
2
3
namespace Zenstruck\Queue\Driver;
4
5
use Predis\ClientInterface;
6
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10
final class PredisDriver extends BaseRedisDriver
11
{
12
    private $client;
13
14
    /**
15
     * @param ClientInterface $client
16
     * @param string          $queueName
17
     */
18 1
    public function __construct(ClientInterface $client, $queueName)
19
    {
20 1
        $this->client = $client;
21
22 1
        parent::__construct($queueName);
23 1
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    protected function rPush($queueName, $payload)
29
    {
30 1
        $this->client->rpush($queueName, $payload);
31 1
    }
32
33
    /**
34
     * {@inheritdoc}
35
     */
36 1
    protected function lPop($queueName)
37
    {
38 1
        return $this->client->lpop($queueName);
39
    }
40
}
41