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

UndefinedSettingException::forSetting()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 2
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
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