Completed
Push — master ( 6b2d7c...9b8114 )
by Nils
02:18
created

Result::getValue()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace whm\Smoke\Scanner;
4
5
use whm\Smoke\Http\Response;
6
7
class Result
8
{
9
    private $type;
10
    private $messages = array();
11
    private $response;
12
    private $parent;
13
    private $url;
14
    private $duration;
15
16
    private $value;
17
    private $attributes = array();
18
19
    public function __construct($uri, $type, Response $response, $parent, $duration)
20
    {
21
        $this->type = $type;
22
        $this->url = $uri;
23
        $this->response = $response;
24
        $this->parent = $parent;
25
        $this->duration = $duration;
26
    }
27
28
    public function setValue($value)
29
    {
30
        $this->value = $value;
31
    }
32
33
    /**
34
     * @return mixed
35
     */
36
    public function getValue()
37
    {
38
        return $this->value;
39
    }
40
41
    /**
42
     * @param array $attributes
43
     */
44
    public function setAttributes($attributes)
45
    {
46
        $this->attributes = $attributes;
47
    }
48
49
    /**
50
     * @return array
51
     */
52
    public function getAttributes()
53
    {
54
        return $this->attributes;
55
    }
56
57
    public function isFailure()
58
    {
59
        return $this->type === Scanner::ERROR;
60
    }
61
62
    public function isSuccess()
63
    {
64
        return $this->type === Scanner::PASSED;
65
    }
66
67
    /**
68
     * @return array
69
     */
70
    public function getMessages()
71
    {
72
        return $this->messages;
73
    }
74
75
    public function setMessages(array $messages)
76
    {
77
        $this->messages = $messages;
78
    }
79
80
    /**
81
     * @return mixed
82
     */
83
    public function getResponse()
84
    {
85
        return $this->response;
86
    }
87
88
    /**
89
     * @return mixed
90
     */
91
    public function getParent()
92
    {
93
        return $this->parent;
94
    }
95
96
    /**
97
     * @return mixed
98
     */
99
    public function getUrl()
100
    {
101
        return $this->url;
102
    }
103
104
    public function getDuration()
105
    {
106
        return $this->duration;
107
    }
108
}
109