@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $params = Util::getHeaderParams($response->getHeaders()); |
| 153 | 153 | |
| 154 | 154 | |
| 155 | - if (! isset($params['x-upyun-list-iter'])) { |
|
| 155 | + if (!isset($params['x-upyun-list-iter'])) { |
|
| 156 | 156 | if (is_resource($saveHandler)) { |
| 157 | 157 | Psr7\Utils::copyToStream($response->getBody(), Psr7\Utils::streamFor($saveHandler)); |
| 158 | 158 | return true; |
@@ -256,7 +256,7 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public function createDir($path) |
| 258 | 258 | { |
| 259 | - $path = rtrim($path, '/') . '/'; |
|
| 259 | + $path = rtrim($path, '/').'/'; |
|
| 260 | 260 | $req = new Rest($this->config); |
| 261 | 261 | $res = $req->request('POST', $path) |
| 262 | 262 | ->withHeader('folder', 'true') |
@@ -286,9 +286,9 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function usage($path = '/') |
| 288 | 288 | { |
| 289 | - $path = rtrim($path, '/') . '/'; |
|
| 289 | + $path = rtrim($path, '/').'/'; |
|
| 290 | 290 | $req = new Rest($this->config); |
| 291 | - $response = $req->request('GET', $path . '?usage') |
|
| 291 | + $response = $req->request('GET', $path.'?usage') |
|
| 292 | 292 | ->send(); |
| 293 | 293 | |
| 294 | 294 | return $response->getBody()->getContents(); |
@@ -304,7 +304,7 @@ discard block |
||
| 304 | 304 | */ |
| 305 | 305 | public function copy($source, $target) |
| 306 | 306 | { |
| 307 | - $source = '/' . $this->config->serviceName . '/' . ltrim($source, '/'); |
|
| 307 | + $source = '/'.$this->config->serviceName.'/'.ltrim($source, '/'); |
|
| 308 | 308 | $req = new Rest($this->config); |
| 309 | 309 | $response = $req->request('PUT', $target) |
| 310 | 310 | ->withHeader('X-Upyun-Copy-Source', $source) |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | */ |
| 323 | 323 | public function move($source, $target) |
| 324 | 324 | { |
| 325 | - $source = '/' . $this->config->serviceName . '/' . ltrim($source, '/'); |
|
| 325 | + $source = '/'.$this->config->serviceName.'/'.ltrim($source, '/'); |
|
| 326 | 326 | $req = new Rest($this->config); |
| 327 | 327 | $response = $req->request('PUT', $target) |
| 328 | 328 | ->withHeader('X-Upyun-Move-Source', $source) |
@@ -351,7 +351,7 @@ discard block |
||
| 351 | 351 | 'headers' => Signature::getPurgeSignHeader($this->config, $urlString), |
| 352 | 352 | 'form_params' => ['purge' => $urlString] |
| 353 | 353 | ]); |
| 354 | - $result = json_decode((string)$response->getBody(), true); |
|
| 354 | + $result = json_decode((string) $response->getBody(), true); |
|
| 355 | 355 | return $result['invalid_domain_of_url']; |
| 356 | 356 | } |
| 357 | 357 | |
@@ -399,7 +399,7 @@ discard block |
||
| 399 | 399 | $video = new Api\Pretreat($this->config); |
| 400 | 400 | |
| 401 | 401 | $options = array(); |
| 402 | - switch($type) { |
|
| 402 | + switch ($type) { |
|
| 403 | 403 | case self::$PROCESS_TYPE_MEDIA: |
| 404 | 404 | $options['accept'] = 'json'; |
| 405 | 405 | $options['source'] = $source; |
@@ -26,17 +26,17 @@ |
||
| 26 | 26 | 'timeout' => $this->config->timeout, |
| 27 | 27 | ]); |
| 28 | 28 | |
| 29 | - $path = '/' . $this->config->serviceName . $path; |
|
| 29 | + $path = '/'.$this->config->serviceName.$path; |
|
| 30 | 30 | $method = 'POST'; |
| 31 | 31 | $signedHeaders = Signature::getHeaderSign($this->config, $method, $path); |
| 32 | 32 | |
| 33 | - $url = $this->config->getSyncVideoEndPoint() . $path; |
|
| 33 | + $url = $this->config->getSyncVideoEndPoint().$path; |
|
| 34 | 34 | $response = $client->request($method, $url, [ |
| 35 | 35 | 'headers' => $signedHeaders, |
| 36 | 36 | 'json' => $params |
| 37 | 37 | ]); |
| 38 | 38 | |
| 39 | - $body = (string)$response->getBody(); |
|
| 39 | + $body = (string) $response->getBody(); |
|
| 40 | 40 | return json_decode($body, true); |
| 41 | 41 | } |
| 42 | 42 | } |