definitionClassDoesNotExist()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Spatie\ServerMonitor\Exceptions;
4
5
use Exception;
6
use Spatie\ServerMonitor\Models\Check;
7
8
class InvalidCheckDefinition extends Exception
9
{
10
    public static function unknownCheckType(Check $check)
11
    {
12
        $validValues = implode(', ', array_keys(config('server-monitor.checks')));
13
14
        return new static("The check with id `{$check->id}` has an unknown type `{$check->type}`. Valid values are {$validValues}");
15
    }
16
17
    public static function definitionClassDoesNotExist(Check $check, string $definitionClass)
18
    {
19
        return new static("The definition class {$definitionClass} specified in the configfile as `{$check->type}` does not exist");
20
    }
21
}
22