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

MemcachedDriver   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A _setContainer() 0 9 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
}