Completed
Push — apc-module ( 2cc8cc...2718a4 )
by Akihito
01:44
created

StorageApcCacheProvider::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 0
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 Doctrine\Common\Cache\ApcuCache;
10
use Ray\Di\Di\Named;
11
use Ray\Di\ProviderInterface;
12
13
class StorageApcCacheProvider implements ProviderInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    private $namespace;
19
20
    /**
21
     * @Named("namespace=cache_namespace")
22
     */
23
    public function __construct(string $namespace = '')
24
    {
25
        $this->namespace = $namespace;
26
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31
    public function get()
32
    {
33
        $cache = new ApcuCache;
34
        $cache->setNamespace($this->namespace);
35
36
        return $cache;
37
    }
38
}
39