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

MemcachedDriver::_setContainer()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 9
ccs 5
cts 5
cp 1
rs 9.6666
c 0
b 0
f 0
cc 2
eloc 4
nc 2
nop 0
crap 2
1
<?php
2
3
namespace hamburgscleanest\GuzzleAdvancedThrottle\Cache\Drivers;
4
5
use hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\MemcachedServersNotSetException;
6
use Illuminate\Cache\MemcachedConnector;
7
8
/**
9
 * Class MemcachedDriver
10
 * @package hamburgscleanest\GuzzleAdvancedThrottle\Cache\Drivers
11
 */
12
class MemcachedDriver extends LaravelDriver
13
{
14
15
    /**
16
     * @throws \hamburgscleanest\GuzzleAdvancedThrottle\Exceptions\MemcachedServersNotSetException
17
     */
18 3
    protected function _setContainer() : void
19
    {
20 3
        if (!isset($this->_options['servers']))
21
        {
22 1
            throw new MemcachedServersNotSetException();
23
        }
24
25 2
        $this->_setStoreValue('servers', $this->_options['servers']);
26 2
        $this->_container['memcached.connector'] = new MemcachedConnector();
27
    }
28
}