@@ -29,7 +29,7 @@ |
||
29 | 29 | } |
30 | 30 | |
31 | 31 | $this->app->make('filesystem') |
32 | - ->extend('cosv5', function ($app, $config) { |
|
32 | + ->extend('cosv5', function($app, $config) { |
|
33 | 33 | $client = new Client($config); |
34 | 34 | $flysystem = new Filesystem(new Adapter($client, $config), $config); |
35 | 35 |
@@ -30,19 +30,19 @@ |
||
30 | 30 | } |
31 | 31 | |
32 | 32 | $this->app->make('filesystem') |
33 | - ->extend('cosv5', function ($app, $config) { |
|
34 | - $client = new Client($config); |
|
35 | - $flysystem = new Filesystem(new Adapter($client, $config), $config); |
|
33 | + ->extend('cosv5', function ($app, $config) { |
|
34 | + $client = new Client($config); |
|
35 | + $flysystem = new Filesystem(new Adapter($client, $config), $config); |
|
36 | 36 | |
37 | - $flysystem->addPlugin(new PutRemoteFile()); |
|
38 | - $flysystem->addPlugin(new PutRemoteFileAs()); |
|
39 | - $flysystem->addPlugin(new GetUrl()); |
|
40 | - $flysystem->addPlugin(new CDN()); |
|
41 | - $flysystem->addPlugin(new TCaptcha()); |
|
42 | - $flysystem->addPlugin(new GetFederationToken()); |
|
37 | + $flysystem->addPlugin(new PutRemoteFile()); |
|
38 | + $flysystem->addPlugin(new PutRemoteFileAs()); |
|
39 | + $flysystem->addPlugin(new GetUrl()); |
|
40 | + $flysystem->addPlugin(new CDN()); |
|
41 | + $flysystem->addPlugin(new TCaptcha()); |
|
42 | + $flysystem->addPlugin(new GetFederationToken()); |
|
43 | 43 | |
44 | - return $flysystem; |
|
45 | - }); |
|
44 | + return $flysystem; |
|
45 | + }); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -335,9 +335,9 @@ discard block |
||
335 | 335 | try { |
336 | 336 | if (isset($this->config['read_from_cdn']) && $this->config['read_from_cdn']) { |
337 | 337 | $response = $this->getHttpClient() |
338 | - ->get($this->applyPathPrefix($path)) |
|
339 | - ->getBody() |
|
340 | - ->getContents(); |
|
338 | + ->get($this->applyPathPrefix($path)) |
|
339 | + ->getBody() |
|
340 | + ->getContents(); |
|
341 | 341 | } else { |
342 | 342 | $response = $this->client->getObject([ |
343 | 343 | 'Bucket' => $this->getBucket(), |
@@ -375,9 +375,9 @@ discard block |
||
375 | 375 | $temporaryUrl = $this->getTemporaryUrl($path, Carbon::now()->addMinutes(5)); |
376 | 376 | |
377 | 377 | $stream = $this->getHttpClient() |
378 | - ->get($temporaryUrl, ['stream' => true]) |
|
379 | - ->getBody() |
|
380 | - ->detach(); |
|
378 | + ->get($temporaryUrl, ['stream' => true]) |
|
379 | + ->getBody() |
|
380 | + ->detach(); |
|
381 | 381 | |
382 | 382 | return ['stream' => $stream]; |
383 | 383 | } catch (NoSuchKeyException $e) { |
@@ -271,12 +271,12 @@ |
||
271 | 271 | return true; |
272 | 272 | } |
273 | 273 | |
274 | - $keys = array_map(function ($item) { |
|
274 | + $keys = array_map(function($item) { |
|
275 | 275 | return ['Key' => $item['Key']]; |
276 | 276 | }, (array) $response['Contents']); |
277 | 277 | |
278 | 278 | // ignore directory |
279 | - $keys = array_filter($keys, function ($item) { |
|
279 | + $keys = array_filter($keys, function($item) { |
|
280 | 280 | return substr($item['Key'], -1) !== '/'; |
281 | 281 | }); |
282 | 282 |
@@ -131,7 +131,7 @@ |
||
131 | 131 | */ |
132 | 132 | protected function buildFormParams(array $values, $key, $action) |
133 | 133 | { |
134 | - $keys = array_map(function ($n) use ($key) { |
|
134 | + $keys = array_map(function($n) use ($key) { |
|
135 | 135 | return sprintf("{$key}.%d", $n); |
136 | 136 | }, range(0, count($values) - 1)); |
137 | 137 |