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

Configuration   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
eloc 8
dl 0
loc 38
ccs 10
cts 10
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getTypes() 0 7 2
A __construct() 0 7 2
A setTypes() 0 3 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