Skip to content

Commit f3b758c

Browse files
committed
stardard PSR2
1 parent 5244969 commit f3b758c

File tree

7 files changed

+57
-53
lines changed

7 files changed

+57
-53
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
}
1414
],
1515
"require": {
16-
"php": ">=5.3.3"
16+
"php": ">=5.3.3",
17+
"squizlabs/php_codesniffer": "~2.3"
1718
},
1819
"require-dev": {
19-
"phpunit/phpunit": "~4.0",
20-
"squizlabs/php_codesniffer": "~2.0"
20+
"phpunit/phpunit": "~4.0"
2121
},
2222
"autoload": {
2323
"psr-4": {"Qiniu\\": "src/Qiniu"},

src/Qiniu/Config.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@ final class Config
55
{
66
const SDK_VER = '7.0.0';
77

8-
const IO_HOST = 'http://iovip.qbox.me'; // 七牛源站Host
9-
const RS_HOST = 'http://rs.qbox.me'; // 文件元信息管理操作Host
10-
const RSF_HOST = 'http://rsf.qbox.me'; // 列举操作Host
11-
const API_HOST = 'http://api.qiniu.com'; // 数据处理操作Host
8+
const IO_HOST = 'http://iovip.qbox.me'; // 七牛源站Host
9+
const RS_HOST = 'http://rs.qbox.me'; // 文件元信息管理操作Host
10+
const RSF_HOST = 'http://rsf.qbox.me'; // 列举操作Host
11+
const API_HOST = 'http://api.qiniu.com'; // 数据处理操作Host
1212

13-
const UPAUTO_HOST = 'http://up.qiniu.com'; // 默认上传Host
14-
const UPDX_HOST = 'http://updx.qiniu.com'; // 电信上传Host
15-
const UPLT_HOST = 'http://uplt.qiniu.com'; // 联通上传Host
16-
const UPYD_HOST = 'http://upyd.qiniu.com'; // 移动上传Host
17-
const UPBACKUP_HOST = 'http://upload.qiniu.com';// 备用上传Host
13+
const UPAUTO_HOST = 'http://up.qiniu.com'; // 默认上传Host
14+
const UPDX_HOST = 'http://updx.qiniu.com'; // 电信上传Host
15+
const UPLT_HOST = 'http://uplt.qiniu.com'; // 联通上传Host
16+
const UPYD_HOST = 'http://upyd.qiniu.com'; // 移动上传Host
17+
const UPBACKUP_HOST = 'http://upload.qiniu.com'; // 备用上传Host
1818

19-
const BLOCK_SIZE = 4194304; //4*1024*1024 断点续上传分块大小,该参数为接口规格,暂不支持修改
19+
const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,暂不支持修改
2020

21-
public static $defaultHost = self::UPAUTO_HOST; // 设置为默认上传Host
21+
public static $defaultHost = self::UPAUTO_HOST; // 设置为默认上传Host
2222
}
23-

src/Qiniu/Processing/PersistentFop.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ public function __construct($auth, $bucket, $pipeline = null, $notify_url = null
4747
*
4848
* @param $key 待处理的源文件
4949
* @param $fops 处理详细操作,规格详见 http://developer.qiniu.com/docs/v6/api/reference/fop/
50-
*
50+
*
5151
* @return array[] 返回持久化处理的persistentId,类似{"persistentId": 5476bedf7823de4068253bae}
52-
*
52+
*
5353
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/list.html
5454
*/
5555
public function execute($key, array $fops)

src/Qiniu/Storage/BucketManager.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
*/
1414
final class BucketManager
1515
{
16-
/**
17-
* @var Qiniu\Auth 账号管理密钥对
16+
/**
17+
* @var Qiniu\Auth 账号管理密钥对
1818
*/
1919
private $auth;
2020

@@ -23,9 +23,9 @@ public function __construct(Auth $auth)
2323
$this->auth = $auth;
2424
}
2525

26-
/**
26+
/**
2727
* 获取指定账号下所有的空间名。
28-
*
28+
*
2929
* @return string[] 包含所有空间名
3030
*/
3131
public function buckets()
@@ -41,14 +41,14 @@ public function buckets()
4141
* @param $marker 列举标识符
4242
* @param $limit 单次列举个数限制
4343
* @param $delimiter 指定目录分隔符
44-
*
44+
*
4545
* @return array[] 包含文件信息的数组,类似:[
4646
* {
47-
* "hash" => "<Hash string>",
47+
* "hash" => "<Hash string>",
4848
* "key" => "<Key string>",
4949
* "fsize" => "<file size>",
5050
* "putTime" => "<file modify time>"
51-
* },
51+
* },
5252
* ...
5353
* ]
5454
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/list.html
@@ -82,15 +82,15 @@ public function listFiles($bucket, $prefix = null, $marker = null, $limit = 1000
8282
*
8383
* @param $bucket 待获取信息资源所在的空间
8484
* @param $key 待获取资源的文件名
85-
*
85+
*
8686
* @return array[] 包含文件信息的数组,类似:
8787
* [
88-
* "hash" => "<Hash string>",
88+
* "hash" => "<Hash string>",
8989
* "key" => "<Key string>",
9090
* "fsize" => "<file size>",
9191
* "putTime" => "<file modify time>"
92-
* ]
93-
*
92+
* ]
93+
*
9494
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/stat.html
9595
*/
9696
public function stat($bucket, $key)
@@ -104,7 +104,7 @@ public function stat($bucket, $key)
104104
*
105105
* @param $bucket 待删除资源所在的空间
106106
* @param $key 待删除资源的文件名
107-
*
107+
*
108108
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
109109
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/delete.html
110110
*/
@@ -122,7 +122,7 @@ public function delete($bucket, $key)
122122
* @param $bucket 待操作资源所在空间
123123
* @param $oldname 待操作资源文件名
124124
* @param $newname 目标资源文件名
125-
*
125+
*
126126
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
127127
*/
128128
public function rename($bucket, $oldname, $newname)
@@ -137,7 +137,7 @@ public function rename($bucket, $oldname, $newname)
137137
* @param $from_key 待操作资源文件名
138138
* @param $to_bucket 目标资源空间名
139139
* @param $to_key 目标资源文件名
140-
*
140+
*
141141
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
142142
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/copy.html
143143
*/
@@ -157,7 +157,7 @@ public function copy($from_bucket, $from_key, $to_bucket, $to_key)
157157
* @param $from_key 待操作资源文件名
158158
* @param $to_bucket 目标资源空间名
159159
* @param $to_key 目标资源文件名
160-
*
160+
*
161161
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
162162
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/move.html
163163
*/
@@ -176,7 +176,7 @@ public function move($from_bucket, $from_key, $to_bucket, $to_key)
176176
* @param $bucket 待操作资源所在空间
177177
* @param $key 待操作资源文件名
178178
* @param $mime 待操作文件目标mimeType
179-
*
179+
*
180180
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
181181
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/chgm.html
182182
*/
@@ -195,7 +195,7 @@ public function changeMime($bucket, $key, $mime)
195195
* @param $url 指定的URL
196196
* @param $bucket 目标资源空间
197197
* @param $key 目标资源文件名
198-
*
198+
*
199199
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
200200
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/fetch.html
201201
*/
@@ -213,7 +213,7 @@ public function fetch($url, $bucket, $key)
213213
*
214214
* @param $bucket 待获取资源所在的空间
215215
* @param $key 代获取资源文件名
216-
*
216+
*
217217
* @return 成功返回NULL,失败返回对象{"error" => "<errMsg string>", ...}
218218
* @link http://developer.qiniu.com/docs/v6/api/reference/rs/prefetch.html
219219
*/
@@ -229,7 +229,7 @@ public function prefetch($bucket, $key)
229229
* 在单次请求中进行多个资源管理操作
230230
*
231231
* @param $operations 资源管理操作数组
232-
*
232+
*
233233
* @return 每个资源的处理情况,结果类似:
234234
* [
235235
* { "code" => <HttpCode int>, "data" => <Data> },

src/Qiniu/Storage/ResumeUploader.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
use Qiniu\Http\Error;
77

88
/**
9-
* 断点续上传类, 该类主要实现了断点续上传中的分块上传,以及相应地创建块和创建文件过程.
10-
*
9+
* 断点续上传类, 该类主要实现了断点续上传中的分块上传,
10+
* 以及相应地创建块和创建文件过程.
11+
*
1112
* @link http://developer.qiniu.com/docs/v6/api/reference/up/mkblk.html
1213
* @link http://developer.qiniu.com/docs/v6/api/reference/up/mkfile.html
1314
*/
@@ -31,8 +32,10 @@ final class ResumeUploader
3132
* @param $key 上传文件名
3233
* @param $inputStream 上传二进制流
3334
* @param $size 上传流的大小
34-
* @param $params 自定义变量,规格参考 http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
35+
* @param $params 自定义变量
3536
* @param $mime 上传数据的mimeType
37+
*
38+
* @link http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
3639
*/
3740
public function __construct(
3841
$upToken,

src/Qiniu/Storage/UploadManager.php

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,16 @@ public function __construct()
2323
* @param $upToken 上传凭证
2424
* @param $key 上传文件名
2525
* @param $data 上传二进制流
26-
* @param $params 自定义变量,规格参考 http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
26+
* @param $params 自定义变量,规格参考
27+
* http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
2728
* @param $mime 上传数据的mimeType
2829
* @param $checkCrc 是否校验crc32
29-
*
30+
*
3031
* @return array[] 包含已上传文件的信息,类似:
3132
* [
32-
* "hash" => "<Hash string>",
33+
* "hash" => "<Hash string>",
3334
* "key" => "<Key string>"
34-
* ]
35+
* ]
3536
*/
3637
public function put(
3738
$upToken,
@@ -59,15 +60,16 @@ public function put(
5960
* @param $upToken 上传凭证
6061
* @param $key 上传文件名
6162
* @param $filePath 上传文件的路径
62-
* @param $params 自定义变量,规格参考 http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
63+
* @param $params 自定义变量,规格参考
64+
* http://developer.qiniu.com/docs/v6/api/overview/up/response/vars.html#xvar
6365
* @param $mime 上传数据的mimeType
6466
* @param $checkCrc 是否校验crc32
65-
*
67+
*
6668
* @return array[] 包含已上传文件的信息,类似:
6769
* [
68-
* "hash" => "<Hash string>",
70+
* "hash" => "<Hash string>",
6971
* "key" => "<Key string>"
70-
* ]
72+
* ]
7173
*/
7274
public function putFile(
7375
$upToken,

src/Qiniu/functions.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ function crc32_file($file)
2323

2424
/**
2525
* 计算输入流的crc32检验码
26-
*
26+
*
2727
* @param $data 待计算校验码的字符串
28-
*
28+
*
2929
* @return 输入字符串的crc32校验码
3030
*/
3131
function crc32_data($data)
@@ -37,9 +37,9 @@ function crc32_data($data)
3737

3838
/**
3939
* 对提供的数据进行urlsafe的base64编码。
40-
*
40+
*
4141
* @param string $data 待编码的数据,一般为字符串
42-
*
42+
*
4343
* @return string 编码后的字符串
4444
* @link http://developer.qiniu.com/docs/v6/api/overview/appendix.html#urlsafe-base64
4545
*/
@@ -52,9 +52,9 @@ function base64_urlSafeEncode($data)
5252

5353
/**
5454
* 对提供的urlsafe的base64编码的数据进行解码
55-
*
55+
*
5656
* @param string $data 待解码的数据,一般为字符串
57-
*
57+
*
5858
* @return string 解码后的字符串
5959
*/
6060
function base64_urlSafeDecode($str)

0 commit comments

Comments
 (0)