Completed
Pull Request — 1.x (#32)
by Akihito
02:24
created

StorageMemcachedModule::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * This file is part of the BEAR.QueryRepository package.
4
 *
5
 * @license http://opensource.org/licenses/MIT MIT
6
 */
7
namespace BEAR\QueryRepository;
8
9
use BEAR\RepositoryModule\Annotation\Storage;
10
use Doctrine\Common\Cache\CacheProvider;
11
use Ray\Di\AbstractModule;
12
13
class StorageMemcachedModule extends AbstractModule
14
{
15
    /**
16
     * @var array
17
     */
18
    private $servers;
19
20 1
    public function __construct(array $servers, AbstractModule $module = null)
21
    {
22 1
        $this->servers = $servers;
23 1
        parent::__construct($module);
24 1
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29 1
    protected function configure()
30
    {
31 1
        $this->bind()->annotatedWith('memcached_servers')->toInstance($this->servers);
32 1
        $this->bind(CacheProvider::class)->annotatedWith(Storage::class)->toProvider(StorageMemcachedCacheProvider::class);
33 1
    }
34
}
35