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

NullConfig   A

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
 * 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