Completed
Push — master ( af31d4...ec158a )
by Timo
10s
created

RedisDriver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
dl 0
loc 14
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A _setContainer() 0 8 2
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Cache\Drivers;
4
5
use hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\RedisDatabaseNotSetException;
6
use Illuminate\Redis\RedisManager;
7
8
/**
9
 * Class RedisDriver
10
 * @package hamburgscleanest\GuzzleAdvancedThrottle\Cache\Drivers
11
 */
12
class RedisDriver extends LaravelDriver
13
{
14
15
    /**
16
     * @throws \hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\RedisDatabaseNotSetException
17
     */
18 3
    protected function _setContainer() : void
19
    {
20 3
        if (!isset($this->_options['database']))
21
        {
22 1
            throw new RedisDatabaseNotSetException();
23
        }
24
25 2
        $this->_container['redis'] = new RedisManager('predis', $this->_options['database']);
26
    }
27
}