Code Duplication    Length = 12-13 lines in 3 locations

src/Models/Concerns/HandlesCheckResult.php 3 locations

@@ 14-25 (lines=12) @@
11
12
trait HandlesCheckResult
13
{
14
    public function succeeded(string $message = '')
15
    {
16
        $this->status = CheckStatus::SUCCESS;
17
        $this->message = $message;
18
19
        $this->save();
20
21
        event(new CheckSucceeded($this));
22
        ConsoleOutput::info($this->host->name . ": check `{$this->type}` succeeded");
23
24
        return $this;
25
    }
26
27
    public function warn(string $warningMessage = '')
28
    {
@@ 27-39 (lines=13) @@
24
        return $this;
25
    }
26
27
    public function warn(string $warningMessage = '')
28
    {
29
        $this->status = CheckStatus::WARNING;
30
        $this->message = $warningMessage;
31
32
        $this->save();
33
34
        event(new CheckWarning($this));
35
36
        ConsoleOutput::info($this->host->name . ": check `{$this->type}` issued warning");
37
38
        return $this;
39
    }
40
41
    public function failed(string $failureReason = '')
42
    {
@@ 41-53 (lines=13) @@
38
        return $this;
39
    }
40
41
    public function failed(string $failureReason = '')
42
    {
43
        $this->status = CheckStatus::FAILED;
44
        $this->message = $failureReason;
45
46
        $this->save();
47
48
        event(new CheckFailed($this));
49
50
        ConsoleOutput::error($this->host->name . ": check `{$this->type}` failed");
51
52
        return $this;
53
    }
54
}