RuntimeError   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
eloc 7
c 1
b 0
f 0
dl 0
loc 19
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A envFileNotFound() 0 3 1
A __construct() 0 6 1
A keyNotFound() 0 3 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace RemotelyLiving\PHPEnv\Exceptions;
6
7
final class RuntimeError extends Exception
8
{
9
    private function __construct(string $message = "", int $code = 0, \Throwable $previous = null)
10
    {
11
        parent::__construct(
12
            $message,
13
            $code,
14
            $previous
15
        );
16
    }
17
18
    public static function keyNotFound(string $key): self
19
    {
20
        return new static("{$key} does not exist in this environment");
21
    }
22
23
    public static function envFileNotFound(string $path): self
24
    {
25
        return new static("{$path} does not exist as a readable env file");
26
    }
27
}
28