Result   A
last analyzed

Complexity

Total Complexity 9

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 1
Metric Value
eloc 15
c 2
b 0
f 1
dl 0
loc 54
rs 10
wmc 9

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getLabel() 0 3 1
A getError() 0 3 1
A getDetails() 0 3 1
A setSuccess() 0 3 1
A setError() 0 4 1
A isSuccess() 0 3 1
A setDetails() 0 3 1
A getSuccess() 0 3 1
1
<?php
2
namespace BretRZaun\StatusPage;
3
4
class Result
5
{
6
    protected $success = true;
7
    protected $error;
8
    protected $label;
9
    protected $details;
10
11
    public function __construct(string $label)
12
    {
13
        $this->label = $label;
14
    }
15
16
    public function getLabel(): string
17
    {
18
        return $this->label;
19
    }
20
21
    public function setSuccess(bool $success): void
22
    {
23
        $this->success = $success;
24
    }
25
26
    /**
27
     * @deprecated
28
     */
29
    public function getSuccess(): bool
30
    {
31
        return $this->success;
32
    }
33
34
    public function isSuccess(): bool
35
    {
36
        return $this->success;
37
    }
38
39
    public function setError(string $error): void
40
    {
41
        $this->setSuccess(false);
42
        $this->error = $error;
43
    }
44
45
    public function getError(): ?string
46
    {
47
        return $this->error;
48
    }
49
50
    public function setDetails(string $details): void
51
    {
52
        $this->details = $details;
53
    }
54
55
    public function getDetails(): ?string
56
    {
57
        return $this->details;
58
    }
59
}
60