RuntimeError::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 3
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