Completed
Branch master (1f9106)
by Nils
02:44
created

Result   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 9
c 0
b 0
f 0
lcom 1
cbo 0
dl 0
loc 70
rs 10

9 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 8 1
A isFailure() 0 4 1
A isSuccess() 0 4 1
A getMessages() 0 4 1
A setMessages() 0 4 1
A getResponse() 0 4 1
A getParent() 0 4 1
A getUrl() 0 4 1
A getDuration() 0 4 1
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
    public function __construct($uri, $type, Response $response, $parent, $duration)
17
    {
18
        $this->type = $type;
19
        $this->url = $uri;
20
        $this->response = $response;
21
        $this->parent = $parent;
22
        $this->duration = $duration;
23
    }
24
25
    public function isFailure()
26
    {
27
        return $this->type === Scanner::ERROR;
28
    }
29
30
    public function isSuccess()
31
    {
32
        return $this->type === Scanner::PASSED;
33
    }
34
35
    /**
36
     * @return array
37
     */
38
    public function getMessages()
39
    {
40
        return $this->messages;
41
    }
42
43
    public function setMessages(array $messages)
44
    {
45
        $this->messages = $messages;
46
    }
47
48
    /**
49
     * @return mixed
50
     */
51
    public function getResponse()
52
    {
53
        return $this->response;
54
    }
55
56
    /**
57
     * @return mixed
58
     */
59
    public function getParent()
60
    {
61
        return $this->parent;
62
    }
63
64
    /**
65
     * @return mixed
66
     */
67
    public function getUrl()
68
    {
69
        return $this->url;
70
    }
71
72
    public function getDuration()
73
    {
74
        return $this->duration;
75
    }
76
}
77