AbstractSection::getValues()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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