RedisDriver::_setContainer()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 3
c 2
b 0
f 1
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
cc 2
nc 2
nop 0
crap 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