@@ -50,18 +50,18 @@ discard block |
||
| 50 | 50 | BucketFactoryInterface $bucketFactory, |
| 51 | 51 | StorageConfig $config, |
| 52 | 52 | Container $app |
| 53 | - ) { |
|
| 53 | + ){ |
|
| 54 | 54 | $manager = new Storage($config->getDefaultBucket()); |
| 55 | 55 | |
| 56 | 56 | $distributions = $config->getDistributions(); |
| 57 | 57 | |
| 58 | - foreach ($config->getAdapters() as $name => $adapter) { |
|
| 58 | + foreach ($config->getAdapters() as $name => $adapter){ |
|
| 59 | 59 | $resolver = null; |
| 60 | 60 | |
| 61 | - if (isset($distributions[$name])) { |
|
| 62 | - try { |
|
| 61 | + if (isset($distributions[$name])){ |
|
| 62 | + try{ |
|
| 63 | 63 | $cdn = $app->make(CdnInterface::class); |
| 64 | - } catch (NotFoundException $e) { |
|
| 64 | + }catch (NotFoundException $e){ |
|
| 65 | 65 | $message = 'Unable to create distribution for bucket "%s". ' |
| 66 | 66 | . 'Please make sure that bootloader %s is added in your application'; |
| 67 | 67 | $message = \sprintf($message, $name, DistributionBootloader::class); |
@@ -78,15 +78,15 @@ discard block |
||
| 78 | 78 | return $manager; |
| 79 | 79 | }); |
| 80 | 80 | |
| 81 | - $app->bindSingleton(Storage::class, static function (StorageInterface $manager) { |
|
| 81 | + $app->bindSingleton(Storage::class, static function (StorageInterface $manager){ |
|
| 82 | 82 | return $manager; |
| 83 | 83 | }); |
| 84 | 84 | |
| 85 | - $app->bindSingleton(BucketInterface::class, static function (StorageInterface $manager) { |
|
| 85 | + $app->bindSingleton(BucketInterface::class, static function (StorageInterface $manager){ |
|
| 86 | 86 | return $manager->bucket(); |
| 87 | 87 | }); |
| 88 | 88 | |
| 89 | - $app->bindSingleton(Bucket::class, static function (BucketInterface $storage) { |
|
| 89 | + $app->bindSingleton(Bucket::class, static function (BucketInterface $storage){ |
|
| 90 | 90 | return $storage; |
| 91 | 91 | }); |
| 92 | 92 | } |
@@ -55,13 +55,18 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | $distributions = $config->getDistributions(); |
| 57 | 57 | |
| 58 | - foreach ($config->getAdapters() as $name => $adapter) { |
|
| 58 | + foreach ($config->getAdapters() as $name => $adapter) |
|
| 59 | + { |
|
| 59 | 60 | $resolver = null; |
| 60 | 61 | |
| 61 | - if (isset($distributions[$name])) { |
|
| 62 | - try { |
|
| 62 | + if (isset($distributions[$name])) |
|
| 63 | + { |
|
| 64 | + try |
|
| 65 | + { |
|
| 63 | 66 | $cdn = $app->make(CdnInterface::class); |
| 64 | - } catch (NotFoundException $e) { |
|
| 67 | + } |
|
| 68 | + catch (NotFoundException $e) |
|
| 69 | + { |
|
| 65 | 70 | $message = 'Unable to create distribution for bucket "%s". ' |
| 66 | 71 | . 'Please make sure that bootloader %s is added in your application'; |
| 67 | 72 | $message = \sprintf($message, $name, DistributionBootloader::class); |
@@ -78,15 +83,18 @@ discard block |
||
| 78 | 83 | return $manager; |
| 79 | 84 | }); |
| 80 | 85 | |
| 81 | - $app->bindSingleton(Storage::class, static function (StorageInterface $manager) { |
|
| 86 | + $app->bindSingleton(Storage::class, static function (StorageInterface $manager) |
|
| 87 | + { |
|
| 82 | 88 | return $manager; |
| 83 | 89 | }); |
| 84 | 90 | |
| 85 | - $app->bindSingleton(BucketInterface::class, static function (StorageInterface $manager) { |
|
| 91 | + $app->bindSingleton(BucketInterface::class, static function (StorageInterface $manager) |
|
| 92 | + { |
|
| 86 | 93 | return $manager->bucket(); |
| 87 | 94 | }); |
| 88 | 95 | |
| 89 | - $app->bindSingleton(Bucket::class, static function (BucketInterface $storage) { |
|
| 96 | + $app->bindSingleton(Bucket::class, static function (BucketInterface $storage) |
|
| 97 | + { |
|
| 90 | 98 | return $storage; |
| 91 | 99 | }); |
| 92 | 100 | } |
@@ -53,7 +53,7 @@ |
||
| 53 | 53 | FilesystemAdapter $adapter, |
| 54 | 54 | string $name, |
| 55 | 55 | UriResolverInterface $resolver = null |
| 56 | - ) { |
|
| 56 | + ){ |
|
| 57 | 57 | return $adapter instanceof LocalFilesystemAdapter |
| 58 | 58 | && $name === 'default' |
| 59 | 59 | && $resolver === null; |