Redis   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 18
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A flush() 0 3 1
1
<?php
2
3
namespace MatthiasMullie\Scrapbook\Adapters\Collections;
4
5
use MatthiasMullie\Scrapbook\Adapters\Redis as Adapter;
6
7
/**
8
 * Redis adapter for a subset of data, in a different database.
9
 *
10
 * @author Matthias Mullie <[email protected]>
11
 * @copyright Copyright (c) 2014, Matthias Mullie. All rights reserved
12
 * @license LICENSE MIT
13
 */
14
class Redis extends Adapter
15
{
16
    /**
17
     * @param \Redis $client
18
     * @param int    $database
19
     */
20
    public function __construct($client, $database)
21
    {
22
        parent::__construct($client);
23
        $this->client->select($database);
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function flush()
30
    {
31
        return $this->client->flushDB();
32
    }
33
}
34