Completed
Push — master ( e0fb57...7519fb )
by Tim
09:19 queued 07:48
created

TestResult::getState()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace SimpleSAML\Module\monitor;
4
5
final class TestResult
6
{
7
    /**
8
     * @var string
9
     */
10
    private $category;
11
12
    /**
13
     * @var string
14
     */
15
    private $subject;
16
17
    /**
18
     * @var string
19
     */
20
    private $message;
0 ignored issues
show
Unused Code introduced by
The property $message is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
21
22
    /**
23
     * @var State
24
     */
25
    private $state = State::NOSTATE;
26
27
    /**
28
     * @param string $category
29
     * @param string $subject
30
     */
31
    public function __construct($category = 'Unknown category', $subject = 'Unknown subject')
32
    {
33
        $this->category = $category;
34
        $this->subject = $subject;
35
    }
36
37
    /**
38
     * @param State $state
39
     *
40
     * @return void
41
     */
42
    public function setState($state = State::NOSTATE)
43
    {
44
        assert($state instanceof State);
45
        $this->state = $state;
46
    }
47
48
    /**
49
     * @return State
50
     */
51
    public function getState()
52
    {
53
        assert($this->state instanceof State);
54
        return $this->state;
55
    }
56
}
57