@@ -51,16 +51,16 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | private function concatenate(string $folder, string $target): string |
| 53 | 53 | { |
| 54 | - if (! $this->chunksFilesystem()->isLocal()) { |
|
| 54 | + if (!$this->chunksFilesystem()->isLocal()) { |
|
| 55 | 55 | return $this->temporaryConcatenate($target, $this->listChunks($folder)); |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - $chunks = $this->listChunks($folder)->map(function (Chunk $item) { |
|
| 58 | + $chunks = $this->listChunks($folder)->map(function(Chunk $item) { |
|
| 59 | 59 | return $item->getPath(); |
| 60 | 60 | }); |
| 61 | 61 | $merge = $chunks->first(); |
| 62 | 62 | |
| 63 | - if (! $this->chunksFilesystem()->concatenate($merge, $chunks->toArray())) { |
|
| 63 | + if (!$this->chunksFilesystem()->concatenate($merge, $chunks->toArray())) { |
|
| 64 | 64 | throw new ChunkyException('Unable to concatenate chunks'); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | private function temporaryConcatenate(string $target, Collection $chunks) |
| 83 | 83 | { |
| 84 | 84 | $stream = new AppendStream; |
| 85 | - $chunks->each(function (Chunk $chunk) use ($stream) { |
|
| 85 | + $chunks->each(function(Chunk $chunk) use ($stream) { |
|
| 86 | 86 | $path = $this->temp_filesystem->store('tmp-'.$chunk->getFilename(), $this->chunksFilesystem()->readChunk($chunk->getPath())); |
| 87 | 87 | $stream->append($this->temp_filesystem->readFile($path)); |
| 88 | 88 | }); |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | $total_size = $request->totalSizeInput(); |
| 132 | 132 | |
| 133 | 133 | if (empty($connection = $this->settings()->connection())) { |
| 134 | - if (! $this->checkChunksIntegrity($folder, $chunk_size, $total_size)) { |
|
| 134 | + if (!$this->checkChunksIntegrity($folder, $chunk_size, $total_size)) { |
|
| 135 | 135 | throw new ChunksIntegrityException('Chunks total file size doesnt match with original file size'); |
| 136 | 136 | } |
| 137 | 137 | |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | public function merge(string $chunks_folder, string $merge_path): string |
| 154 | 154 | { |
| 155 | 155 | // Check chunks folder |
| 156 | - if (! $this->isValidChunksFolder($chunks_folder)) { |
|
| 156 | + if (!$this->isValidChunksFolder($chunks_folder)) { |
|
| 157 | 157 | throw new ChunkyException("Invalid chunks folder {$chunks_folder}"); |
| 158 | 158 | } |
| 159 | 159 | |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $path = $this->concatenate($chunks_folder, $merge_path); |
| 162 | 162 | |
| 163 | 163 | // Final check and cleanup |
| 164 | - if (! $path) { |
|
| 164 | + if (!$path) { |
|
| 165 | 165 | throw new ChunkyException('An error occurred while moving merge to destination'); |
| 166 | 166 | } |
| 167 | 167 | |
@@ -182,7 +182,7 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | public function __call($method, $parameters) |
| 184 | 184 | { |
| 185 | - if (! method_exists($this, $method)) { |
|
| 185 | + if (!method_exists($this, $method)) { |
|
| 186 | 186 | return $this->forwardCallTo($this->manager(), $method, $parameters); |
| 187 | 187 | } |
| 188 | 188 | |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | private function registerBindings() |
| 66 | 66 | { |
| 67 | - $this->app->singleton(TempFilesystem::class, function () { |
|
| 67 | + $this->app->singleton(TempFilesystem::class, function() { |
|
| 68 | 68 | $config = $this->app->make('config'); |
| 69 | 69 | $filesystem = new TempFilesystem(app()->make(Factory::class)); |
| 70 | 70 | |
@@ -77,11 +77,11 @@ discard block |
||
| 77 | 77 | $this->app->bind(ChunksFilesystem::class, ChunksFilesystem::class); |
| 78 | 78 | $this->app->bind(MergeFilesystem::class, MergeFilesystem::class); |
| 79 | 79 | |
| 80 | - $this->app->singleton(ChunkySettings::class, function (Container $app) { |
|
| 80 | + $this->app->singleton(ChunkySettings::class, function(Container $app) { |
|
| 81 | 81 | return new ChunkySettings($app->make('config')); |
| 82 | 82 | }); |
| 83 | 83 | |
| 84 | - $this->app->singleton(ChunkyManagerContract::class, function (Container $app) { |
|
| 84 | + $this->app->singleton(ChunkyManagerContract::class, function(Container $app) { |
|
| 85 | 85 | return new ChunkyManager($app->make(ChunkySettings::class)); |
| 86 | 86 | }); |
| 87 | 87 | } |