RedisDriver   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 9
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 2
eloc 4
c 2
b 0
f 1
dl 0
loc 9
ccs 4
cts 4
cp 1
rs 10

1 Method

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