Skip to content

Commit ca1d6ac

Browse files
committed
Merge pull request #128 from rwifeng/scrutinizer_check
fix comment format
2 parents 14fbf5a + 5ed009d commit ca1d6ac

File tree

6 files changed

+31
-25
lines changed

6 files changed

+31
-25
lines changed

src/Qiniu/Etag.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public static function sum($filename)
5252
fclose($fhandler);
5353
return array(null, $err);
5454
}
55-
list($sha1Code, $err) = calSha1($fdata);
55+
list($sha1Code, ) = calSha1($fdata);
5656
$sha1Buf = array_merge($sha1Buf, $sha1Code);
5757
} else {
5858
array_push($sha1Buf, 0x96);
@@ -67,7 +67,7 @@ public static function sum($filename)
6767
$sha1BlockBuf = array_merge($sha1BlockBuf, $sha1Code);
6868
}
6969
$tmpData = self::packArray('C*', $sha1BlockBuf);
70-
list($sha1Final, $_err) = self::calcSha1($tmpData);
70+
list($sha1Final, ) = self::calcSha1($tmpData);
7171
$sha1Buf = array_merge($sha1Buf, $sha1Final);
7272
}
7373
$etag = \Qiniu\base64_urlSafeEncode(self::packArray('C*', $sha1Buf));

src/Qiniu/Processing/Operation.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function __construct($domain, $auth = null, $token_expire = 3600)
2727
* @param $fops string|array fop操作,多次fop操作以array的形式传入。
2828
* eg. imageView2/1/w/200/h/200, imageMogr2/thumbnail/!75px
2929
*
30-
* @return array[] 文件处理后的结果及错误。
30+
* @return array 文件处理后的结果及错误。
3131
*
3232
* @link http://developer.qiniu.com/docs/v6/api/reference/fop/
3333
*/

src/Qiniu/Processing/PersistentFop.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ final class PersistentFop
3333
*/
3434
private $notify_url;
3535

36+
/**
37+
* @var 是否强制覆盖已有的重名文件
38+
*/
39+
private $force;
40+
41+
3642
public function __construct($auth, $bucket, $pipeline = null, $notify_url = null, $force = false)
3743
{
3844
$this->auth = $auth;
@@ -49,7 +55,7 @@ public function __construct($auth, $bucket, $pipeline = null, $notify_url = null
4955
* @param $fops string|array 待处理的pfop操作,多个pfop操作以array的形式传入。
5056
* eg. avthumb/mp3/ab/192k, vframe/jpg/offset/7/w/480/h/360
5157
*
52-
* @return array[] 返回持久化处理的persistentId, 和返回的错误。
58+
* @return array 返回持久化处理的persistentId, 和返回的错误。
5359
*
5460
* @link http://developer.qiniu.com/docs/v6/api/reference/fop/
5561
*/

src/Qiniu/Storage/BucketManager.php

+15-15
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function buckets()
4242
* @param $limit 单次列举个数限制
4343
* @param $delimiter 指定目录分隔符
4444
*
45-
* @return array[] 包含文件信息的数组,类似:[
45+
* @return array 包含文件信息的数组,类似:[
4646
* {
4747
* "hash" => "<Hash string>",
4848
* "key" => "<Key string>",
@@ -83,7 +83,7 @@ public function listFiles($bucket, $prefix = null, $marker = null, $limit = 1000
8383
* @param $bucket 待获取信息资源所在的空间
8484
* @param $key 待获取资源的文件名
8585
*
86-
* @return array[] 包含文件信息的数组,类似:
86+
* @return array 包含文件信息的数组,类似:
8787
* [
8888
* "hash" => "<Hash string>",
8989
* "key" => "<Key string>",
@@ -105,13 +105,13 @@ public function stat($bucket, $key)
105105
* @param $bucket 待删除资源所在的空间
106106
* @param $key 待删除资源的文件名
107107
*
108-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
108+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
109109
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/delete.html
110110
*/
111111
public function delete($bucket, $key)
112112
{
113113
$path = '/delete/' . \Qiniu\entry($bucket, $key);
114-
list($_, $error) = $this->rsPost($path);
114+
list(, $error) = $this->rsPost($path);
115115
return $error;
116116
}
117117

@@ -123,7 +123,7 @@ public function delete($bucket, $key)
123123
* @param $oldname 待操作资源文件名
124124
* @param $newname 目标资源文件名
125125
*
126-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
126+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
127127
*/
128128
public function rename($bucket, $oldname, $newname)
129129
{
@@ -138,15 +138,15 @@ public function rename($bucket, $oldname, $newname)
138138
* @param $to_bucket 目标资源空间名
139139
* @param $to_key 目标资源文件名
140140
*
141-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
141+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
142142
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/copy.html
143143
*/
144144
public function copy($from_bucket, $from_key, $to_bucket, $to_key)
145145
{
146146
$from = \Qiniu\entry($from_bucket, $from_key);
147147
$to = \Qiniu\entry($to_bucket, $to_key);
148148
$path = '/copy/' . $from . '/' . $to;
149-
list($_, $error) = $this->rsPost($path);
149+
list(, $error) = $this->rsPost($path);
150150
return $error;
151151
}
152152

@@ -158,15 +158,15 @@ public function copy($from_bucket, $from_key, $to_bucket, $to_key)
158158
* @param $to_bucket 目标资源空间名
159159
* @param $to_key 目标资源文件名
160160
*
161-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
161+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
162162
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/move.html
163163
*/
164164
public function move($from_bucket, $from_key, $to_bucket, $to_key)
165165
{
166166
$from = \Qiniu\entry($from_bucket, $from_key);
167167
$to = \Qiniu\entry($to_bucket, $to_key);
168168
$path = '/move/' . $from . '/' . $to;
169-
list($_, $error) = $this->rsPost($path);
169+
list(, $error) = $this->rsPost($path);
170170
return $error;
171171
}
172172

@@ -177,15 +177,15 @@ public function move($from_bucket, $from_key, $to_bucket, $to_key)
177177
* @param $key 待操作资源文件名
178178
* @param $mime 待操作文件目标mimeType
179179
*
180-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
180+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
181181
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/chgm.html
182182
*/
183183
public function changeMime($bucket, $key, $mime)
184184
{
185185
$resource = \Qiniu\entry($bucket, $key);
186186
$encode_mime = \Qiniu\base64_urlSafeEncode($mime);
187187
$path = '/chgm/' . $resource . '/mime/' .$encode_mime;
188-
list($_, $error) = $this->rsPost($path);
188+
list(, $error) = $this->rsPost($path);
189189
return $error;
190190
}
191191

@@ -196,7 +196,7 @@ public function changeMime($bucket, $key, $mime)
196196
* @param $bucket 目标资源空间
197197
* @param $key 目标资源文件名
198198
*
199-
* @return array[] 包含已拉取的文件信息。
199+
* @return array 包含已拉取的文件信息。
200200
* 成功时: [
201201
* [
202202
* "hash" => "<Hash string>",
@@ -226,14 +226,14 @@ public function fetch($url, $bucket, $key)
226226
* @param $bucket 待获取资源所在的空间
227227
* @param $key 代获取资源文件名
228228
*
229-
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
229+
* @return mixed 成功返回NULL,失败返回对象Qiniu\Http\Error
230230
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/prefetch.html
231231
*/
232232
public function prefetch($bucket, $key)
233233
{
234234
$resource = \Qiniu\entry($bucket, $key);
235235
$path = '/prefetch/' . $resource;
236-
list($_, $error) = $this->ioPost($path);
236+
list(, $error) = $this->ioPost($path);
237237
return $error;
238238
}
239239

@@ -242,7 +242,7 @@ public function prefetch($bucket, $key)
242242
*
243243
* @param $operations 资源管理操作数组
244244
*
245-
* @return 每个资源的处理情况,结果类似:
245+
* @return array 每个资源的处理情况,结果类似:
246246
* [
247247
* { "code" => <HttpCode int>, "data" => <Data> },
248248
* { "code" => <HttpCode int> },

src/Qiniu/Storage/UploadManager.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function __construct()
2828
* @param $mime 上传数据的mimeType
2929
* @param $checkCrc 是否校验crc32
3030
*
31-
* @return array[] 包含已上传文件的信息,类似:
31+
* @return array 包含已上传文件的信息,类似:
3232
* [
3333
* "hash" => "<Hash string>",
3434
* "key" => "<Key string>"
@@ -65,7 +65,7 @@ public function put(
6565
* @param $mime 上传数据的mimeType
6666
* @param $checkCrc 是否校验crc32
6767
*
68-
* @return array[] 包含已上传文件的信息,类似:
68+
* @return array 包含已上传文件的信息,类似:
6969
* [
7070
* "hash" => "<Hash string>",
7171
* "key" => "<Key string>"

src/Qiniu/functions.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*
1313
* @param $file string 待计算校验码的文件路径
1414
*
15-
* @return 文件内容的crc32校验码
15+
* @return string 文件内容的crc32校验码
1616
*/
1717
function crc32_file($file)
1818
{
@@ -26,7 +26,7 @@ function crc32_file($file)
2626
*
2727
* @param $data 待计算校验码的字符串
2828
*
29-
* @return 输入字符串的crc32校验码
29+
* @return string 输入字符串的crc32校验码
3030
*/
3131
function crc32_data($data)
3232
{
@@ -53,7 +53,7 @@ function base64_urlSafeEncode($data)
5353
/**
5454
* 对提供的urlsafe的base64编码的数据进行解码
5555
*
56-
* @param string $data 待解码的数据,一般为字符串
56+
* @param string $str 待解码的数据,一般为字符串
5757
*
5858
* @return string 解码后的字符串
5959
*/
@@ -108,7 +108,7 @@ function json_decode($json, $assoc = false, $depth = 512)
108108
* @param $bucket 待操作的空间名
109109
* @param $key 待操作的文件名
110110
*
111-
* @return 符合七牛API规格的数据格式
111+
* @return string 符合七牛API规格的数据格式
112112
* @link http://developer.qiniu.com/docs/v6/api/reference/data-formats.html
113113
*/
114114
function entry($bucket, $key)

0 commit comments

Comments
 (0)