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

HealthInspectionFailure   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 4
lcom 1
cbo 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A inspection() 0 4 1
A reason() 0 4 1
A wasUnexpected() 0 4 1
1
<?php
2
3
namespace Spatie\Backup\Tasks\Monitor;
4
5
use Exception;
6
use Spatie\Backup\Exceptions\InvalidHealthCheck;
7
8
class HealthInspectionFailure
9
{
10
    /** @var HealthInspection */
11
    protected $inspection;
12
13
    /** @var Exception */
14
    protected $exception;
15
16
    public function __construct(HealthInspection $inspection, Exception $exception)
17
    {
18
        $this->inspection = $inspection;
19
        $this->exception = $exception;
20
    }
21
22
    public function inspection()
23
    {
24
        return $this->inspection;
25
    }
26
27
    public function reason()
28
    {
29
        return $this->exception;
30
    }
31
32
    public function wasUnexpected()
33
    {
34
        return ! $this->exception instanceof InvalidHealthCheck;
35
    }
36
}