@@ -37,6 +37,6 @@ |
||
| 37 | 37 | // Get file stream from remote url |
| 38 | 38 | $resource = fopen($remoteUrl, 'r'); |
| 39 | 39 | |
| 40 | - return (bool)$this->filesystem->getAdapter()->writeStream($path, $resource, $config); |
|
| 40 | + return (bool) $this->filesystem->getAdapter()->writeStream($path, $resource, $config); |
|
| 41 | 41 | } |
| 42 | 42 | } |
@@ -34,6 +34,6 @@ |
||
| 34 | 34 | $config->setFallback($this->filesystem->getConfig()); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | - return (bool)$this->filesystem->getAdapter()->writeFile($path, $filePath, $config); |
|
| 37 | + return (bool) $this->filesystem->getAdapter()->writeFile($path, $filePath, $config); |
|
| 38 | 38 | } |
| 39 | 39 | } |
@@ -565,7 +565,7 @@ |
||
| 565 | 565 | * @param string $path |
| 566 | 566 | * @param \DateTimeInterface|int $expiration |
| 567 | 567 | * @param array $options |
| 568 | - * @return string |
|
| 568 | + * @return \OSS\Http\ResponseCore |
|
| 569 | 569 | * |
| 570 | 570 | * @throws \RuntimeException |
| 571 | 571 | */ |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $config->set(static::$metaMap['ACL'], $this->getObjectACL($path)); |
| 196 | 196 | } |
| 197 | 197 | // 允许覆盖同名文件 |
| 198 | - $config->set('x-oss-forbid-overwrite','false'); |
|
| 198 | + $config->set('x-oss-forbid-overwrite', 'false'); |
|
| 199 | 199 | |
| 200 | 200 | return $this->write($path, $contents, $config); |
| 201 | 201 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $config->set(static::$metaMap['ACL'], $this->getObjectACL($path)); |
| 211 | 211 | } |
| 212 | 212 | // 允许覆盖同名文件 |
| 213 | - $config->set('x-oss-forbid-overwrite','false'); |
|
| 213 | + $config->set('x-oss-forbid-overwrite', 'false'); |
|
| 214 | 214 | |
| 215 | 215 | return $this->writeStream($path, $resource, $config); |
| 216 | 216 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | public function deleteDir($dirname) |
| 270 | 270 | { |
| 271 | - $dirname = rtrim($this->applyPathPrefix($dirname), '/') . '/'; |
|
| 271 | + $dirname = rtrim($this->applyPathPrefix($dirname), '/').'/'; |
|
| 272 | 272 | $dirObjects = $this->listDirObjects($dirname, true); |
| 273 | 273 | |
| 274 | 274 | if (count($dirObjects['objects']) > 0) { |
@@ -420,7 +420,7 @@ discard block |
||
| 420 | 420 | public function read($path) |
| 421 | 421 | { |
| 422 | 422 | $result = $this->readObject($path); |
| 423 | - $result['contents'] = (string)$result['raw_contents']; |
|
| 423 | + $result['contents'] = (string) $result['raw_contents']; |
|
| 424 | 424 | unset($result['raw_contents']); |
| 425 | 425 | return $result; |
| 426 | 426 | } |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | $contents = $dirObjects["objects"]; |
| 450 | 450 | |
| 451 | 451 | $result = array_map([$this, 'normalizeResponse'], $contents); |
| 452 | - $result = array_filter($result, function ($value) { |
|
| 452 | + $result = array_filter($result, function($value) { |
|
| 453 | 453 | return $value['path'] !== false; |
| 454 | 454 | }); |
| 455 | 455 | |
@@ -547,7 +547,7 @@ discard block |
||
| 547 | 547 | public function getUrl($path) |
| 548 | 548 | { |
| 549 | 549 | // if (!$this->has($path)) throw new FileNotFoundException($path.' not found'); |
| 550 | - return ($this->ssl ? 'https://' : 'http://') . ($this->isCname ? ($this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain) : $this->bucket . '.' . $this->endPoint) . '/' . ltrim($path, '/'); |
|
| 550 | + return ($this->ssl ? 'https://' : 'http://').($this->isCname ? ($this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain) : $this->bucket.'.'.$this->endPoint).'/'.ltrim($path, '/'); |
|
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | /** |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | protected function logErr($func, $e) |
| 667 | 667 | { |
| 668 | 668 | if ($this->debug) { |
| 669 | - Log::error($func . ": FAILED"); |
|
| 669 | + Log::error($func.": FAILED"); |
|
| 670 | 670 | Log::error($e->getMessage()); |
| 671 | 671 | } |
| 672 | 672 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | if ($this->app->runningInConsole()) { |
| 26 | 26 | $this->publishes([ |
| 27 | - __DIR__ . '/config/config.php' => config_path('aliyun-oss.php'), |
|
| 27 | + __DIR__.'/config/config.php' => config_path('aliyun-oss.php'), |
|
| 28 | 28 | ], 'config'); |
| 29 | 29 | } |
| 30 | 30 | $this->mergeConfigFrom( |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | 35 | $this->app->make('filesystem') |
| 36 | - ->extend('aliyun', function ($app, array $config) { |
|
| 36 | + ->extend('aliyun', function($app, array $config) { |
|
| 37 | 37 | $config = $app->make(AliyunOssConfig::class, ['config' => $config]); |
| 38 | 38 | $client = $app->get(OssClient::class); |
| 39 | 39 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | public function register() |
| 50 | 50 | { |
| 51 | - $this->app->singleton(AliyunOssConfig::class, function ($app, $params = []) { |
|
| 51 | + $this->app->singleton(AliyunOssConfig::class, function($app, $params = []) { |
|
| 52 | 52 | if (isset($params['config'])) { |
| 53 | 53 | $config = $params['config']; |
| 54 | 54 | } else { |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | return $ossConfig; |
| 60 | 60 | }); |
| 61 | 61 | |
| 62 | - $this->app->singleton(OssClient::class, function ($app) { |
|
| 62 | + $this->app->singleton(OssClient::class, function($app) { |
|
| 63 | 63 | $ossConfig = $app->get(AliyunOssConfig::class); |
| 64 | 64 | $ossClient = new OssClient( |
| 65 | 65 | $ossConfig->getAccessId(), |