Completed
Pull Request — master (#128)
by Fabien
09:15
created

Stack::isFailed()   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
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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
    public function __construct($client, $request)
42
    {
43
        $this->client = $client;
44
        $this->request = $request;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getClient()
51
    {
52
        return $this->client;
53
    }
54
55
    /**
56
     * @param Profile $profile
57
     */
58
    public function addProfile(Profile $profile)
59
    {
60
        $this->profiles[] = $profile;
61
    }
62
63
    /**
64
     * @return Profile[]
65
     */
66
    public function getProfiles()
67
    {
68
        return $this->profiles;
69
    }
70
71
    /**
72
     * @return string
73
     */
74
    public function getRequest()
75
    {
76
        return $this->request;
77
    }
78
79
    /**
80
     * @return string
81
     */
82
    public function getResponse()
83
    {
84
        return $this->response;
85
    }
86
87
    /**
88
     * @param string $response
89
     */
90
    public function setResponse($response)
91
    {
92
        $this->response = $response;
93
    }
94
95
    /**
96
     * @return bool
97
     */
98
    public function isFailed()
99
    {
100
        return $this->failed;
101
    }
102
103
    /**
104
     * @param bool $failed
105
     */
106
    public function setFailed($failed)
107
    {
108
        $this->failed = $failed;
109
    }
110
}
111