Completed
Pull Request — master (#789)
by
unknown
02:03
created

HealthInspection   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
handle() 0 1 ?
A name() 0 4 1
A fail() 0 4 1
1
<?php
2
3
namespace Spatie\Backup\Tasks\Monitor;
4
5
use Illuminate\Support\Str;
6
use Spatie\Backup\BackupDestination\BackupDestination;
7
use Spatie\Backup\Exceptions\InvalidHealthCheck;
8
9
abstract class HealthInspection
10
{
11
    abstract public function handle(BackupDestination $backupDestination);
12
13
    public function name()
14
    {
15
        return Str::title(class_basename($this));
16
    }
17
18
    protected function fail($message)
19
    {
20
        throw new InvalidHealthCheck($message);
21
    }
22
}