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

HealthInspectionFailure::inspection()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

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