CURLResponse   A
last analyzed

Complexity

Total Complexity 13

Size/Duplication

Total Lines 160
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 13
lcom 0
cbo 0
dl 0
loc 160
rs 10
c 0
b 0
f 0

13 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getRequestBody() 0 3 1
A getRequestHeader() 0 3 1
A getRequestURL() 0 3 1
A getResponseBody() 0 3 1
A getResponseHeader() 0 3 1
A getResponseInfo() 0 3 1
A setRequestBody() 0 4 1
A setRequestHeader() 0 4 1
A setRequestURL() 0 4 1
A setResponseBody() 0 4 1
A setResponseHeader() 0 4 1
A setResponseInfo() 0 4 1
1
<?php
2
3
/**
4
 * This file is part of the curl-library package.
5
 *
6
 * (c) 2017 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Library\CURL\Response;
13
14
/**
15
 * cURL response.
16
 *
17
 * @author webeweb <https://github.com/webeweb/>
18
 * @package WBW\Library\CURL\Response
19
 */
20
class CURLResponse implements CURLResponseInterface {
21
22
    /**
23
     * Request body.
24
     *
25
     * @var string
26
     */
27
    private $requestBody;
28
29
    /**
30
     * Request header.
31
     *
32
     * @var array
33
     */
34
    private $requestHeader = [];
35
36
    /**
37
     * Request URL.
38
     *
39
     * @var string
40
     */
41
    private $requestURL;
42
43
    /**
44
     * Response body.
45
     *
46
     * @var string
47
     */
48
    private $responseBody;
49
50
    /**
51
     * Response header.
52
     *
53
     * @var array
54
     */
55
    private $responseHeader = [];
56
57
    /**
58
     * Response info.
59
     *
60
     * @var array
61
     */
62
    private $responseInfo = [];
63
64
    /**
65
     * Constructor.
66
     */
67
    public function __construct() {
68
        // NOTHING TO DO.
69
    }
70
71
    /**
72
     * {@inheritdoc}
73
     */
74
    public function getRequestBody() {
75
        return $this->requestBody;
76
    }
77
78
    /**
79
     * {@inheritdoc}
80
     */
81
    public function getRequestHeader() {
82
        return $this->requestHeader;
83
    }
84
85
    /**
86
     * {@inheritdoc}
87
     */
88
    public function getRequestURL() {
89
        return $this->requestURL;
90
    }
91
92
    /**
93
     * {@inheritdoc}
94
     */
95
    public function getResponseBody() {
96
        return $this->responseBody;
97
    }
98
99
    /**
100
     * {@inheritdoc}
101
     */
102
    public function getResponseHeader() {
103
        return $this->responseHeader;
104
    }
105
106
    /**
107
     * {@inheritdoc}
108
     */
109
    public function getResponseInfo() {
110
        return $this->responseInfo;
111
    }
112
113
    /**
114
     * Set the request body.
115
     *
116
     * @param string $requestBody The request body.
117
     * @return CURLResponse Returns this CURL response.
118
     */
119
    public function setRequestBody($requestBody) {
120
        $this->requestBody = $requestBody;
121
        return $this;
122
    }
123
124
    /**
125
     * Set the request header.
126
     *
127
     * @param array $requestHeader The request header.
128
     * @return CURLResponse Returns this CURL response.
129
     */
130
    public function setRequestHeader(array $requestHeader = []) {
131
        $this->requestHeader = $requestHeader;
132
        return $this;
133
    }
134
135
    /**
136
     * Set the request URL.
137
     *
138
     * @param string $requestURL The request URL.
139
     * @return CURLResponse Returns this CURL response.
140
     */
141
    public function setRequestURL($requestURL) {
142
        $this->requestURL = $requestURL;
143
        return $this;
144
    }
145
146
    /**
147
     * Set the response body.
148
     *
149
     * @param string $responseBody The response body.
150
     * @return CURLResponse Returns this CURL response.
151
     */
152
    public function setResponseBody($responseBody) {
153
        $this->responseBody = $responseBody;
154
        return $this;
155
    }
156
157
    /**
158
     * Set the response header.
159
     *
160
     * @param array $responseHeader The response header.
161
     * @return CURLResponse Returns this CURL response.
162
     */
163
    public function setResponseHeader(array $responseHeader = []) {
164
        $this->responseHeader = $responseHeader;
165
        return $this;
166
    }
167
168
    /**
169
     * Set the response info.
170
     *
171
     * @param array $responseInfo The response info.
172
     * @return CURLResponse Returns this CURL response.
173
     */
174
    public function setResponseInfo(array $responseInfo = []) {
175
        $this->responseInfo = $responseInfo;
176
        return $this;
177
    }
178
179
}
180