Completed
Push — master ( 792db4...b38394 )
by Casey
04:05
created

UndefinedSettingException   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 2
c 0
b 0
f 0
dl 0
loc 10
ccs 2
cts 2
cp 1
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A forSetting() 0 3 1
1
<?php
2
3
/**
4
 * Settings Manager
5
 *
6
 * @license http://opensource.org/licenses/MIT
7
 * @link https://github.com/caseyamcl/settings-manager
8
 * @package caseyamcl/settings-manager
9
 * @author Casey McLaughlin <[email protected]>
10
 *
11
 * For the full copyright and license information, please view the LICENSE
12
 * file that was distributed with this source code.
13
 *
14
 *  ------------------------------------------------------------------
15
 */
16
17
declare(strict_types=1);
18
19
namespace SettingsManager\Exception;
20
21
use RuntimeException;
22
use Throwable;
23
24
/**
25
 * Class SettingDefinitionNotFoundException
26
 *
27
 * @author Casey McLaughlin <[email protected]>
28
 */
29
class UndefinedSettingException extends RuntimeException implements SettingException
30
{
31
    /**
32
     * @param string $name
33
     * @param Throwable|null $previous
34
     * @return static
35
     */
36 3
    public static function forSetting(string $name, Throwable $previous = null): self
37
    {
38 3
        return new static("Setting definition not found: " . $name, 0, $previous);
39
    }
40
}
41