Completed
Pull Request — master (#602)
by Tom
06:21
created

DBALConfiguration   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 74
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 74
ccs 4
cts 15
cp 0.2667
rs 10
c 0
b 0
f 0
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
 * @link    http://www.doctrine-project.org/
13
 */
14
class DBALConfiguration extends AbstractOptions
15
{
16
    /**
17
     * Set the cache key for the result cache. Cache key
18
     * is assembled as "doctrine.cache.{key}" and pulled from
19
     * service locator.
20
     */
21
    protected string $resultCache = 'array';
0 ignored issues
show
Bug introduced by
This code did not parse for me. Apparently, there is an error somewhere around this line:

Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST
Loading history...
22
23
    /**
24
     * Set the class name of the SQL Logger, or null, to disable.
25
     */
26
    protected ?string $sqlLogger = null;
27
28
    /**
29
     * Keys must be the name of the type identifier and value is
30
     * the class name of the Type
31
     *
32
     * @var string[]
33
     */
34
    protected array $types = [];
35
36
    public function setResultCache(string $resultCache) : self
37
    {
38
        $this->resultCache = $resultCache;
39
40
        return $this;
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
    public function getSqlLogger() : ?string
54
    {
55
        return $this->sqlLogger;
56
    }
57
58
    /**
59
     * @param string[] $types
60
     */
61
    public function setTypes(array $types) : self
62
    {
63
        $this->types = $types;
64
65
        return $this;
66
    }
67 86
68
    /**
69 86
     * @return string[]
70
     */
71
    public function getTypes() : array
72
    {
73
        return $this->types;
74
    }
75
}
76