Test Failed
Push — master ( 313b01...13aa75 )
by Sébastien
08:22
created

Configuration::getMetadataCache()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
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
namespace Bdf\Prime;
4
5
use Bdf\Prime\Types\TypesRegistry;
6
use Bdf\Prime\Types\TypesRegistryInterface;
7
use Doctrine\DBAL\Configuration as BaseConfiguration;
8
9
/**
10
 * Configuration
11
 */
12
class Configuration extends BaseConfiguration
13
{
14
    /**
15
     * Set configuration
16
     * 
17
     * @param array $options
18
     */
19
    public function __construct(array $options = [])
0 ignored issues
show
Coding Style introduced by
Expected 1 blank line before function; 0 found
Loading history...
20
    {
21 208
        $this->_attributes = $options + [
0 ignored issues
show
Coding Style introduced by
Operation must be bracketed
Loading history...
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
22
            'sqlLogger' => isset($options['logger']) ? $options['logger'] : null,
23 208
        ];
24 208
        
25
        unset($this->_attributes['logger']);
26
    }
27
28
    /**
29
     * Set common type registry
30 208
     *
31 208
     * @param TypesRegistryInterface $types
32
     */
33
    public function setTypes(TypesRegistryInterface $types)
34
    {
35
        $this->_attributes['types'] = $types;
36
    }
37
38 1
    /**
39
     * Get common types registry
40 1
     *
41 1
     * @return TypesRegistryInterface
42
     */
43
    public function getTypes()
44
    {
45
        if (!isset($this->_attributes['types'])) {
46 127
            $this->setTypes(new TypesRegistry());
47
        }
48 127
49
        return $this->_attributes['types'];
50
    }
51
}
52