NullConfig   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 2
c 0
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getValue() 0 3 1
1
<?php
2
declare(strict_types=1);
3
4
namespace SKien\Config;
5
6
/**
7
 * Class for empty config.
8
 *
9
 * This class can be used to implement the <b>Null object Design Pattern</b>
10
 * (https://designpatternsphp.readthedocs.io/en/latest/Behavioral/NullObject/README.html).
11
 *
12
 * All calls to getXXX() allways returns the passed default value.
13
 * This class can be used as default instance for any module that uses
14
 * an Configuration imlementing the ConfigInterface.
15
 *
16
 * @package Config
17
 * @author Stefanius <[email protected]>
18
 * @copyright MIT License - see the LICENSE file for details
19
 */
20
class NullConfig extends AbstractConfig
21
{
22
    /**
23
     * Allways return the specified default value.
24
     * @param string $strPath
25
     * @param mixed $default
26
     * @return mixed
27
     */
28
    public function getValue(string $strPath, $default = null)
29
    {
30
        return $default;
31
    }
32
}
33