@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | return $req->upload($path, $stream, $params); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if (! $useBlock) { |
|
| 36 | + if (!$useBlock) { |
|
| 37 | 37 | $req = new Rest($this->config); |
| 38 | 38 | return $req->request('PUT', $path) |
| 39 | 39 | ->withHeaders($params) |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $headers = array(); |
| 62 | 62 | if (is_array($params)) { |
| 63 | 63 | foreach ($params as $key => $val) { |
| 64 | - $headers['X-Upyun-Meta-' . $key] = $val; |
|
| 64 | + $headers['X-Upyun-Meta-'.$key] = $val; |
|
| 65 | 65 | } |
| 66 | 66 | } |
| 67 | 67 | $res = $req->request('PUT', $path) |
@@ -118,13 +118,13 @@ discard block |
||
| 118 | 118 | * @return mixed |
| 119 | 119 | * @throws \Exception |
| 120 | 120 | */ |
| 121 | - public function initiateMultipartUpload($path, $size, $params=[]) |
|
| 121 | + public function initiateMultipartUpload($path, $size, $params = []) |
|
| 122 | 122 | { |
| 123 | 123 | $req = new Rest($this->config); |
| 124 | 124 | $headers = array(); |
| 125 | 125 | if (is_array($params)) { |
| 126 | 126 | foreach ($params as $key => $val) { |
| 127 | - $headers['X-Upyun-Meta-' . $key] = $val; |
|
| 127 | + $headers['X-Upyun-Meta-'.$key] = $val; |
|
| 128 | 128 | } |
| 129 | 129 | } |
| 130 | 130 | |
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $headers = array(); |
| 225 | 225 | if (is_array($params)) { |
| 226 | 226 | foreach ($params as $key => $val) { |
| 227 | - $headers['X-Upyun-Meta-' . $key] = $val; |
|
| 227 | + $headers['X-Upyun-Meta-'.$key] = $val; |
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | $res = $req->request('PUT', $path) |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | |
| 242 | 242 | $init = Util::getHeaderParams($res->getHeaders()); |
| 243 | 243 | $uuid = $init['x-upyun-multi-uuid']; |
| 244 | - $requests = function ($req, $path, $stream, $uuid) { |
|
| 244 | + $requests = function($req, $path, $stream, $uuid) { |
|
| 245 | 245 | $blockSize = 1024 * 1024; |
| 246 | 246 | $total = ceil($stream->getSize() / $blockSize); |
| 247 | 247 | for ($i = 0; $i < $total; $i++) { |
@@ -261,12 +261,12 @@ discard block |
||
| 261 | 261 | ]); |
| 262 | 262 | $pool = new Pool($client, $requests($req, $path, $stream, $uuid), [ |
| 263 | 263 | 'concurrency' => $this->config->concurrency, |
| 264 | - 'fulfilled' => function ($res) { |
|
| 264 | + 'fulfilled' => function($res) { |
|
| 265 | 265 | if ($res->getStatusCode() !== 204) { |
| 266 | 266 | throw new \Exception('upload request failed when poinit upload!'); |
| 267 | 267 | } |
| 268 | 268 | }, |
| 269 | - 'rejected' => function () { |
|
| 269 | + 'rejected' => function() { |
|
| 270 | 270 | throw new \Exception('upload request failed when poinit upload!'); |
| 271 | 271 | }, |
| 272 | 272 | ]); |