Skip to content

Commit ff33bc0

Browse files
committed
5.3
1 parent 0770216 commit ff33bc0

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/Qiniu/Etag.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public static function sum($filename)
4646
$sha1Buf = array();
4747

4848
if ($blockCnt <= 1) {
49-
$sha1Buf[] = 0x16;
49+
array_push($sha1Buf, 0x16);
5050
$fdata = fread($fhandler, Config::BLOCK_SIZE);
5151
if ($err != null) {
5252
fclose($fhandler);
@@ -55,7 +55,7 @@ public static function sum($filename)
5555
list($sha1Code, $err) = calSha1($fdata);
5656
$sha1Buf = array_merge($sha1Buf, $sha1Code);
5757
} else {
58-
$sha1Buf[] = 0x96;
58+
array_push($sha1Buf, 0x96);
5959
$sha1BlockBuf = array();
6060
for ($i=0; $i < $blockCnt; $i++) {
6161
$fdata = fread($fhandler, Config::BLOCK_SIZE);

src/Qiniu/Http/Client.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
final class Client
99
{
10-
public static function get($url, array $headers = [])
10+
public static function get($url, array $headers = array())
1111
{
1212
$request = new Request('GET', $url, $headers);
1313
return self::sendRequest($request);
1414
}
1515

16-
public static function post($url, $body, array $headers = [])
16+
public static function post($url, $body, array $headers = array())
1717
{
1818
$request = new Request('POST', $url, $headers, $body);
1919
return self::sendRequest($request);
@@ -26,7 +26,7 @@ public static function multipartPost(
2626
$fileName,
2727
$fileBody,
2828
$mimeType = null,
29-
array $headers = []
29+
array $headers = array()
3030
) {
3131
$data = array();
3232
$mimeBoundary = md5(microtime());
@@ -88,7 +88,7 @@ private static function sendRequest($request)
8888
if (!empty($request->headers)) {
8989
$headers = array();
9090
foreach ($request->headers as $key => $val) {
91-
$headers[] = "$key: $val";
91+
array_push($headers, "$key: $val");
9292
}
9393
$options[CURLOPT_HTTPHEADER] = $headers;
9494
}

src/Qiniu/Http/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ final class Request
88
public $body;
99
public $method;
1010

11-
public function __construct($method, $url, array $headers = [], $body = null)
11+
public function __construct($method, $url, array $headers = array(), $body = null)
1212
{
1313
$this->method = strtoupper($method);
1414
$this->url = $url;

src/Qiniu/Http/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ final class Response
7676
511 => 'Network Authentication Required',
7777
);
7878

79-
public function __construct($code, $duration, array $headers = [], $body = null, $error = null)
79+
public function __construct($code, $duration, array $headers = array(), $body = null, $error = null)
8080
{
8181
$this->statusCode = $code;
8282
$this->duration = $duration;
@@ -117,15 +117,15 @@ public function __construct($code, $duration, array $headers = [], $body = null,
117117
}
118118
}
119119

120-
public function json(array $config = [])
120+
public function json(array $config =array())
121121
{
122122
if ($this->jsonData != null) {
123123
return $this->jsonData;
124124
}
125125
return self::bodyJson($this->body);
126126
}
127127

128-
private static function bodyJson($body, array $config = [])
128+
private static function bodyJson($body, array $config = array())
129129
{
130130
return \Qiniu\json_decode(
131131
(string) $body,

0 commit comments

Comments
 (0)