DBALConfiguration   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 26.67%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 62
ccs 4
cts 15
cp 0.2667
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setResultCache() 0 4 1
A getResultCache() 0 4 1
A setSqlLogger() 0 4 1
A getSqlLogger() 0 4 1
A setTypes() 0 4 1
A getTypes() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineORMModule\Options;
6
7
use Laminas\Stdlib\AbstractOptions;
8
9
/**
10
 * Configuration options for a DBAL Connection
11
 */
12
class DBALConfiguration extends AbstractOptions
13
{
14
    /**
15
     * Set the cache key for the result cache. Cache key
16
     * is assembled as "doctrine.cache.{key}" and pulled from
17
     * service locator.
18
     *
19
     * @var string
20
     */
21
    protected $resultCache = 'array';
22
23
    /**
24
     * Set the class name of the SQL Logger, or null, to disable.
25
     *
26
     * @var string
27
     */
28
    protected $sqlLogger = null;
29
30
    /**
31
     * Keys must be the name of the type identifier and value is
32
     * the class name of the Type
33
     *
34
     * @var mixed[]
35
     */
36
    protected $types = [];
37
38
    public function setResultCache(string $resultCache) : void
39
    {
40
        $this->resultCache = $resultCache;
41
    }
42
43
    public function getResultCache() : string
44
    {
45
        return 'doctrine.cache.' . $this->resultCache;
46
    }
47
48
    public function setSqlLogger(string $sqlLogger) : void
49
    {
50
        $this->sqlLogger = $sqlLogger;
51
    }
52
53 86
    public function getSqlLogger() : ?string
54
    {
55 86
        return $this->sqlLogger;
56
    }
57
58
    /**
59
     * @param mixed[] $types
60
     */
61
    public function setTypes(array $types) : void
62
    {
63
        $this->types = $types;
64
    }
65
66
    /**
67
     * @return mixed
68
     */
69 86
    public function getTypes()
70
    {
71 86
        return $this->types;
72
    }
73
}
74