Completed
Pull Request — master (#128)
by Fabien
10:19 queued 08:15
created

Stack::setFailed()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
3
namespace Http\HttplugBundle\Collector;
4
5
/**
6
 * @author Fabien Bourigault <[email protected]>
7
 *
8
 * @internal
9
 */
10
final class Stack
11
{
12
    /**
13
     * @var string
14
     */
15
    private $client;
16
17
    /**
18
     * @var Profile[]
19
     */
20
    private $profiles = [];
21
22
    /**
23
     * @var string
24
     */
25
    private $request;
26
27
    /**
28
     * @var string
29
     */
30
    private $response;
31
32
    /**
33
     * @var bool
34
     */
35
    private $failed = false;
36
37
    /**
38
     * @param string $client
39
     * @param string $request
40
     */
41 7
    public function __construct($client, $request)
42
    {
43 7
        $this->client = $client;
44 7
        $this->request = $request;
45 7
    }
46
47
    /**
48
     * @return string
49
     */
50 1
    public function getClient()
51
    {
52 1
        return $this->client;
53
    }
54
55
    /**
56
     * @param Profile $profile
57
     */
58 4
    public function addProfile(Profile $profile)
59
    {
60 4
        $this->profiles[] = $profile;
61 4
    }
62
63
    /**
64
     * @return Profile[]
65
     */
66 2
    public function getProfiles()
67
    {
68 2
        return $this->profiles;
69
    }
70
71
    /**
72
     * @return string
73
     */
74 1
    public function getRequest()
75
    {
76 1
        return $this->request;
77
    }
78
79
    /**
80
     * @return string
81
     */
82 1
    public function getResponse()
83
    {
84 1
        return $this->response;
85
    }
86
87
    /**
88
     * @param string $response
89
     */
90 2
    public function setResponse($response)
91
    {
92 2
        $this->response = $response;
93 2
    }
94
95
    /**
96
     * @return bool
97
     */
98
    public function isFailed()
99
    {
100
        return $this->failed;
101
    }
102
103
    /**
104
     * @param bool $failed
105
     */
106 1
    public function setFailed($failed)
107
    {
108 1
        $this->failed = $failed;
109 1
    }
110
}
111