Redis::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
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