Skip to content

Commit 876e483

Browse files
committed
💄
1 parent af7907b commit 876e483

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/CurlHandle.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CurlHandle{
2222
*
2323
* @var resource
2424
*/
25-
public $ch;
25+
public $curl;
2626

2727
/**
2828
* @var \Psr\Http\Message\RequestInterface
@@ -50,10 +50,10 @@ public function __construct(RequestInterface $request, ResponseInterface $respon
5050
$this->request = $request;
5151
$this->response = $response;
5252
$this->options = $options;
53-
$this->ch = curl_init();
53+
$this->curl = curl_init();
5454

5555
if(is_array($this->options->curl_options)){
56-
curl_setopt_array($this->ch, $this->options->curl_options);
56+
curl_setopt_array($this->curl, $this->options->curl_options);
5757
}
5858
}
5959

@@ -69,8 +69,8 @@ public function __destruct(){
6969
*/
7070
public function close():void{
7171

72-
if(is_resource($this->ch)){
73-
curl_close($this->ch);
72+
if(is_resource($this->curl)){
73+
curl_close($this->curl);
7474
}
7575

7676
}
@@ -80,16 +80,16 @@ public function close():void{
8080
*/
8181
public function reset():void{
8282

83-
if(is_resource($this->ch)){
83+
if(is_resource($this->curl)){
8484

85-
curl_setopt_array($this->ch, [
85+
curl_setopt_array($this->curl, [
8686
CURLOPT_HEADERFUNCTION => null,
8787
CURLOPT_READFUNCTION => null,
8888
CURLOPT_WRITEFUNCTION => null,
8989
CURLOPT_PROGRESSFUNCTION => null,
9090
]);
9191

92-
curl_reset($this->ch);
92+
curl_reset($this->curl);
9393
}
9494

9595
}
@@ -150,7 +150,7 @@ public function init(){
150150
}
151151

152152
// Message has non empty body.
153-
if($bodySize === null || $bodySize > 1024 * 1024){
153+
if($bodySize === null || $bodySize > 1 << 20){
154154
// Avoid full loading large or unknown size body into memory
155155
$options[CURLOPT_UPLOAD] = true;
156156

@@ -223,9 +223,9 @@ public function init(){
223223
$options[CURLOPT_HTTPHEADER][] = 'Content-Type:';
224224
}
225225

226-
curl_setopt_array($this->ch, $this->options->curl_options + $options);
226+
curl_setopt_array($this->curl, $this->options->curl_options + $options);
227227

228-
return $this->ch;
228+
return $this->curl;
229229
}
230230

231231
/**

0 commit comments

Comments
 (0)