Completed
Push — master ( 14cfed...b26125 )
by Freek
02:44 queued 35s
created

InvalidConfiguration   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 12
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A checkModelIsNotValid() 0 4 1
A hostModelIsNotValid() 0 4 1
1
<?php
2
3
namespace Spatie\ServerMonitor\Exceptions;
4
5
use Exception;
6
use Spatie\ServerMonitor\Models\Host;
7
use Spatie\ServerMonitor\Models\Check;
8
9
class InvalidConfiguration extends Exception
10
{
11
    public static function checkModelIsNotValid(string $className)
12
    {
13
        return new static("The given model class `{$className}` does not extend `".Check::class.'`');
14
    }
15
16
    public static function hostModelIsNotValid(string $className)
17
    {
18
        return new static("The given model class `{$className}` does not extend `".Host::class.'`');
19
    }
20
}
21