Skip to content

Commit dcce3da

Browse files
authored
Merge pull request #388 from qiniu/ignore-php-8.x-type-check
ignore php8.x type check
2 parents 9d0e591 + 6164ede commit dcce3da

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

src/Qiniu/Auth.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,15 @@ public function signQiniuAuthorization($urlString, $method = "GET", $body = "",
122122

123123
// append body
124124
$data .= "\n\n";
125-
if (strlen($body) > 0
125+
if (!is_null($body)
126+
&& strlen($body) > 0
126127
&& isset($headers["Content-Type"])
127128
&& $headers["Content-Type"] != "application/octet-stream"
128129
) {
129130
$data .= $body;
130131
}
131132

132-
return array($this->sign(utf8_encode($data)), null);
133+
return array($this->sign($data), null);
133134
}
134135

135136
public function verifyCallback($contentType, $originAuthorization, $url, $body)

src/Qiniu/Config.php

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ final class Config
2424
public $useHTTPS;
2525
//BOOL 是否使用CDN加速上传域名
2626
public $useCdnDomains;
27+
/**
28+
* @var Region
29+
*/
30+
public $zone;
2731
// Zone Cache
2832
private $regionCache;
2933

src/Qiniu/Http/Client.php

+3
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ public static function sendRequest($request)
175175

176176
private static function escapeQuotes($str)
177177
{
178+
if (is_null($str)) {
179+
return null;
180+
}
178181
$find = array("\\", "\"");
179182
$replace = array("\\\\", "\\\"");
180183
return str_replace($find, $replace, $str);

src/Qiniu/Http/Header.php

+6
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ public function getRawData()
111111
*
112112
* @return boolean
113113
*/
114+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
114115
public function offsetExists($offset)
115116
{
116117
$key = self::normalizeKey($offset);
@@ -122,6 +123,7 @@ public function offsetExists($offset)
122123
*
123124
* @return string|null
124125
*/
126+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
125127
public function offsetGet($offset)
126128
{
127129
$key = self::normalizeKey($offset);
@@ -138,6 +140,7 @@ public function offsetGet($offset)
138140
*
139141
* @return void
140142
*/
143+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
141144
public function offsetSet($offset, $value)
142145
{
143146
$key = self::normalizeKey($offset);
@@ -151,6 +154,7 @@ public function offsetSet($offset, $value)
151154
/**
152155
* @return void
153156
*/
157+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
154158
public function offsetUnset($offset)
155159
{
156160
$key = self::normalizeKey($offset);
@@ -160,6 +164,7 @@ public function offsetUnset($offset)
160164
/**
161165
* @return \ArrayIterator
162166
*/
167+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
163168
public function getIterator()
164169
{
165170
$arr = array();
@@ -172,6 +177,7 @@ public function getIterator()
172177
/**
173178
* @return int
174179
*/
180+
#[\ReturnTypeWillChange] // temporarily suppress the type check of php 8.x
175181
public function count()
176182
{
177183
return count($this->data);

0 commit comments

Comments
 (0)