@@ -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 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | public function clean() |
39 | 39 | { |
40 | - foreach($this->temp_files as $file) { |
|
40 | + foreach ($this->temp_files as $file) { |
|
41 | 41 | $this->filesystem()->disk($this->disk())->delete($file); |
42 | 42 | } |
43 | 43 | } |