AbstractSection   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 36
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getValue() 0 4 1
A getValues() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of cloak.
5
 *
6
 * (c) Noritaka Horio <[email protected]>
7
 *
8
 * This source file is subject to the MIT license that is bundled
9
 * with this source code in the file LICENSE.
10
 */
11
12
namespace cloak\configuration;
13
14
use Zend\Config\Config;
15
16
17
/**
18
 * Class AbstractNode
19
 * @package cloak\configuration
20
 */
21
abstract class AbstractSection implements Section
22
{
23
24
    /**
25
     * @var Config
26
     */
27
    protected $values;
28
29
30
    /**
31
     * @param array $values
32
     */
33
    public function __construct(array $values = [])
34
    {
35
        $this->values = new Config($values);
36
    }
37
38
    /**
39
     * @param string $key
40
     * @param mixed $defaultValue
41
     * @return mixed
42
     */
43
    public function getValue($key, $defaultValue)
44
    {
45
        return $this->values->get($key, $defaultValue);
46
    }
47
48
    /**
49
     * @return Config
50
     */
51
    public function getValues()
52
    {
53
        return $this->values;
54
    }
55
56
}
57