Cache::getClass()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineModule\Options;
6
7
use Laminas\Stdlib\AbstractOptions;
8
9
/**
10
 * Cache options
11
 *
12
 * @link    http://www.doctrine-project.org/
13
 */
14
class Cache extends AbstractOptions
15
{
16
    /**
17
     * Class used to instantiate the cache.
18
     *
19
     * @var string
20
     */
21
    protected $class = 'Doctrine\Common\Cache\ArrayCache';
22
23
    /**
24
     * Namespace to prefix all cache ids with.
25
     *
26
     * @var string
27
     */
28
    protected $namespace = '';
29
30
    /**
31
     * Directory for file-based caching
32
     *
33
     * @var string
34
     */
35
    protected $directory;
36
37
    /**
38
     * Key to use for fetching the memcache, memcached, or redis instance from
39
     * the service locator. Used only with Memcache. Memcached, and Redis.
40
     *
41
     * @var string|null
42
     */
43
    protected $instance = null;
44
45 3
    public function setClass(string $class) : self
46
    {
47 3
        $this->class = $class;
48
49 3
        return $this;
50
    }
51
52 3
    public function getClass() : string
53
    {
54 3
        return $this->class;
55
    }
56
57 1
    public function setInstance(string $instance) : self
58
    {
59 1
        $this->instance = $instance;
60
61 1
        return $this;
62
    }
63
64 3
    public function getInstance() : ?string
65
    {
66 3
        return $this->instance;
67
    }
68
69 2
    public function setNamespace(string $namespace) : self
70
    {
71 2
        $this->namespace = (string) $namespace;
72
73 2
        return $this;
74
    }
75
76 3
    public function getNamespace() : string
77
    {
78 3
        return $this->namespace;
79
    }
80
81
    public function setDirectory(string $directory) : self
82
    {
83
        $this->directory = $directory;
84
85
        return $this;
86
    }
87
88
    public function getDirectory() : string
89
    {
90
        return $this->directory;
91
    }
92
}
93