Completed
Pull Request — master (#26)
by sabaku
03:35
created
src/Upyun/Uploader.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,9 +31,9 @@
 block discarded – undo
31 31
         if (! $useBlock) {
32 32
             $req = new Rest($this->config);
33 33
             return $req->request('PUT', $path)
34
-                       ->withHeaders($params)
35
-                       ->withFile($stream)
36
-                       ->send();
34
+                        ->withHeaders($params)
35
+                        ->withFile($stream)
36
+                        ->send();
37 37
         } else {
38 38
             return $this->pointUpload($path, $stream, $params);
39 39
         }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
             return $req->upload($path, $stream, $params);
29 29
         }
30 30
 
31
-        if (! $useBlock) {
31
+        if (!$useBlock) {
32 32
             $req = new Rest($this->config);
33 33
             return $req->request('PUT', $path)
34 34
                        ->withHeaders($params)
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         $headers = array();
54 54
         if (is_array($params)) {
55 55
             foreach ($params as $key => $val) {
56
-                $headers['X-Upyun-Meta-' . $key] = $val;
56
+                $headers['X-Upyun-Meta-'.$key] = $val;
57 57
             }
58 58
         }
59 59
         $res = $req->request('PUT', $path)
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
         if ($this->config->uploadType === 'BLOCK') {
107 107
             return true;
108 108
         } else if ($this->config->uploadType === 'AUTO' &&
109
-                  $fileSize >= $this->config->sizeBoundary ) {
109
+                  $fileSize >= $this->config->sizeBoundary) {
110 110
             return true;
111 111
         } else {
112 112
             return false;
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.