Passed
Push — main ( 5396d8...bc775a )
by Stefan
01:33
created

NullConfig::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 2
1
<?php
2
declare(strict_types=1);
3
4
namespace SKien\Config;
5
6
/**
7
 * Class for empty config.
8
 * All calls to getXXX() allways returns the passed default value.
9
 * This class can be used as default instance for any module that uses
10
 * an Configuration imlementing the ConfigInterface.
11
 *
12
 * #### History
13
 * - *2021-01-01*   initial version
14
 *
15
 * @package SKien/GCalendar
16
 * @version 1.0.0
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 retun 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