Completed
Pull Request — master (#26)
by sabaku
03:35
created
src/Upyun/Config.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -87,17 +87,17 @@  discard block
 block discarded – undo
87 87
     /**
88 88
      * 分块上传接口请求地址
89 89
      */
90
-    const ED_FORM            = 'm0.api.upyun.com';
90
+    const ED_FORM = 'm0.api.upyun.com';
91 91
 
92 92
     /**
93 93
      * 异步云处理接口地址
94 94
      */
95
-    const ED_VIDEO           = 'p0.api.upyun.com';
95
+    const ED_VIDEO = 'p0.api.upyun.com';
96 96
 
97 97
     /**
98 98
      * 刷新接口地址
99 99
      */
100
-    const ED_PURGE           = 'http://purge.upyun.com/purge/';
100
+    const ED_PURGE = 'http://purge.upyun.com/purge/';
101 101
 
102 102
     public function __construct($bucketName, $operatorName, $operatorPassword) {
103 103
         $this->bucketName = $bucketName;
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     }
113 113
 
114 114
     public function getFormApiKey() {
115
-        if (! $this->formApiKey) {
115
+        if (!$this->formApiKey) {
116 116
             throw new \Exception('form api key is empty.');
117 117
         }
118 118
 
Please login to merge, or discard this patch.
src/Upyun/Upyun.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
         $params = Util::getHeaderParams($response->getHeaders());
122 122
 
123 123
 
124
-        if (! isset($params['x-upyun-list-iter'])) {
124
+        if (!isset($params['x-upyun-list-iter'])) {
125 125
             if (is_resource($saveHandler)) {
126 126
                 Psr7\copy_to_stream($response->getBody(), Psr7\stream_for($saveHandler));
127 127
                 return true;
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
      * @throws \Exception
207 207
      */
208 208
     public function createDir($path) {
209
-        $path = rtrim($path, '/') . '/';
209
+        $path = rtrim($path, '/').'/';
210 210
         $req = new Rest($this->config);
211 211
         $res = $req->request('POST', $path)
212 212
             ->withHeader('folder', 'true')
@@ -234,9 +234,9 @@  discard block
 block discarded – undo
234 234
      * @throws \Exception
235 235
      */
236 236
     public function usage($path = '/') {
237
-        $path = rtrim($path, '/') . '/';
237
+        $path = rtrim($path, '/').'/';
238 238
         $req = new Rest($this->config);
239
-        $response = $req->request('GET', $path . '?usage')
239
+        $response = $req->request('GET', $path.'?usage')
240 240
             ->send();
241 241
 
242 242
         return $response->getBody()->getContents();
Please login to merge, or discard this patch.
src/Upyun/Util.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -64,16 +64,16 @@
 block discarded – undo
64 64
      */
65 65
     public static function encodeURI($url) {
66 66
         $unescaped = array(
67
-            '%2D'=>'-','%5F'=>'_','%2E'=>'.','%21'=>'!', '%7E'=>'~',
67
+            '%2D'=>'-', '%5F'=>'_', '%2E'=>'.', '%21'=>'!', '%7E'=>'~',
68 68
             '%2A'=>'*', '%27'=>"'", '%28'=>'(', '%29'=>')'
69 69
         );
70 70
         $reserved = array(
71
-            '%3B'=>';','%2C'=>',','%2F'=>'/','%3F'=>'?','%3A'=>':',
72
-            '%40'=>'@','%26'=>'&','%3D'=>'=','%2B'=>'+','%24'=>'$'
71
+            '%3B'=>';', '%2C'=>',', '%2F'=>'/', '%3F'=>'?', '%3A'=>':',
72
+            '%40'=>'@', '%26'=>'&', '%3D'=>'=', '%2B'=>'+', '%24'=>'$'
73 73
         );
74 74
         $score = array(
75 75
             '%23'=>'#'
76 76
         );
77
-        return strtr(rawurlencode($url), array_merge($reserved,$unescaped,$score));
77
+        return strtr(rawurlencode($url), array_merge($reserved, $unescaped, $score));
78 78
     }
79 79
 }
Please login to merge, or discard this patch.