@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | $policy = Util::base64Json($params); |
| 20 | 20 | $method = 'POST'; |
| 21 | - $signature = Signature::getBodySignature($this->config, $method, '/' . $params['bucket'], null, $policy); |
|
| 21 | + $signature = Signature::getBodySignature($this->config, $method, '/'.$params['bucket'], null, $policy); |
|
| 22 | 22 | $client = new Client([ |
| 23 | 23 | 'timeout' => $this->config->timeout, |
| 24 | 24 | ]); |
@@ -29,13 +29,13 @@ discard block |
||
| 29 | 29 | public function __construct(Config $config) |
| 30 | 30 | { |
| 31 | 31 | $this->config = $config; |
| 32 | - $this->endpoint = $config->getProtocol() . Config::$restApiEndPoint . '/' . $config->bucketName; |
|
| 32 | + $this->endpoint = $config->getProtocol().Config::$restApiEndPoint.'/'.$config->bucketName; |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | public function request($method, $storagePath) |
| 36 | 36 | { |
| 37 | 37 | $this->method = strtoupper($method); |
| 38 | - $this->storagePath = '/' . ltrim($storagePath, '/'); |
|
| 38 | + $this->storagePath = '/'.ltrim($storagePath, '/'); |
|
| 39 | 39 | return $this; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | 'timeout' => $this->config->timeout, |
| 63 | 63 | ]); |
| 64 | 64 | |
| 65 | - $url = $this->endpoint . $this->storagePath; |
|
| 65 | + $url = $this->endpoint.$this->storagePath; |
|
| 66 | 66 | $body = null; |
| 67 | 67 | if ($this->file && $this->method === 'PUT') { |
| 68 | 68 | $body = $this->file; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | $method = 'POST'; |
| 41 | 41 | $signedHeaders = Signature::getHeaderSign($this->config, $method, $path); |
| 42 | 42 | |
| 43 | - $url = $this->config->getPretreatEndPoint() . $path; |
|
| 43 | + $url = $this->config->getPretreatEndPoint().$path; |
|
| 44 | 44 | $response = $client->request($method, $url, [ |
| 45 | 45 | 'headers' => $signedHeaders, |
| 46 | 46 | 'form_params' => $params |
@@ -61,10 +61,10 @@ discard block |
||
| 61 | 61 | 'service' => $this->config->bucketName, |
| 62 | 62 | 'task_ids' => implode(',', $taskIds) |
| 63 | 63 | ); |
| 64 | - $path = $path . '?' . http_build_query($params); |
|
| 64 | + $path = $path.'?'.http_build_query($params); |
|
| 65 | 65 | |
| 66 | 66 | $method = 'GET'; |
| 67 | - $url = $this->config->getPretreatEndPoint() . $path; |
|
| 67 | + $url = $this->config->getPretreatEndPoint().$path; |
|
| 68 | 68 | $signedHeaders = Signature::getHeaderSign($this->config, $method, $path); |
| 69 | 69 | $response = $client->request($method, $url, [ |
| 70 | 70 | 'headers' => $signedHeaders |
@@ -79,12 +79,12 @@ discard block |
||
| 79 | 79 | /** |
| 80 | 80 | * 异步云处理接口地址 |
| 81 | 81 | */ |
| 82 | - const ED_VIDEO = 'p0.api.upyun.com'; |
|
| 82 | + const ED_VIDEO = 'p0.api.upyun.com'; |
|
| 83 | 83 | |
| 84 | 84 | /** |
| 85 | 85 | * 刷新接口地址 |
| 86 | 86 | */ |
| 87 | - const ED_PURGE = 'http://purge.upyun.com/purge/'; |
|
| 87 | + const ED_PURGE = 'http://purge.upyun.com/purge/'; |
|
| 88 | 88 | |
| 89 | 89 | public function __construct($bucketName, $operatorName, $operatorPassword) |
| 90 | 90 | { |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | public function getFormApiKey() |
| 104 | 104 | { |
| 105 | - if (! $this->formApiKey) { |
|
| 105 | + if (!$this->formApiKey) { |
|
| 106 | 106 | throw new \Exception('form api key is empty.'); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | |
| 122 | 122 | public function getPretreatEndPoint() |
| 123 | 123 | { |
| 124 | - return $this->getProtocol() . self::ED_VIDEO; |
|
| 124 | + return $this->getProtocol().self::ED_VIDEO; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | public function getProtocol() |