Completed
Push — master ( 362a13...64ee51 )
by WEBEWEB
01:29
created

CurlResponse::getResponseBody()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

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