@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function register() |
32 | 32 | { |
33 | - $this->app->singleton('chunky', function (Container $app) { |
|
33 | + $this->app->singleton('chunky', function(Container $app) { |
|
34 | 34 | $settings = new ChunkySettings( |
35 | 35 | $app->make('config') |
36 | 36 | ); |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | ); |
42 | 42 | }); |
43 | 43 | |
44 | - $this->app->singleton(StrategyFactoryContract::class, function (Container $app) { |
|
44 | + $this->app->singleton(StrategyFactoryContract::class, function(Container $app) { |
|
45 | 45 | return new StrategyFactory( |
46 | 46 | $app->make('config')->get('chunky.strategies') |
47 | 47 | ); |
@@ -107,7 +107,7 @@ |
||
107 | 107 | |
108 | 108 | foreach (config('chunky.validation') as $input => $config) { |
109 | 109 | if ( |
110 | - ! in_array($input, ['index', 'file', 'chunkSize', 'totalSize']) |
|
110 | + !in_array($input, ['index', 'file', 'chunkSize', 'totalSize']) |
|
111 | 111 | && Arr::has($config, 'key') |
112 | 112 | && Arr::has($config, 'rules') |
113 | 113 | ) { |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | public function __call($method, $parameters) |
39 | 39 | { |
40 | - if (! method_exists($this, $method)) { |
|
40 | + if (!method_exists($this, $method)) { |
|
41 | 41 | return $this->forwardCallTo($this->strategy, $method, $parameters); |
42 | 42 | } |
43 | 43 |
@@ -199,7 +199,7 @@ |
||
199 | 199 | |
200 | 200 | public function __call($method, $parameters) |
201 | 201 | { |
202 | - if (! method_exists($this, $method)) { |
|
202 | + if (!method_exists($this, $method)) { |
|
203 | 203 | return $this->forwardCallTo($this->file, $method, $parameters); |
204 | 204 | } |
205 | 205 |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | public function chunks(string $folder): Collection |
179 | 179 | { |
180 | 180 | return collect($this->chunksFilesystem()->files($folder)) |
181 | - ->map(function ($path) use ($folder) { |
|
181 | + ->map(function($path) use ($folder) { |
|
182 | 182 | $filename = str_replace($folder.DIRECTORY_SEPARATOR, '', $path); |
183 | 183 | $exploded_name = explode('_', $filename); |
184 | 184 | $index = array_shift($exploded_name); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | 'index' => intval($index), |
188 | 188 | 'path' => $path, |
189 | 189 | ]; |
190 | - })->sortBy(function ($item) { |
|
190 | + })->sortBy(function($item) { |
|
191 | 191 | return $item['index']; |
192 | 192 | }); |
193 | 193 | } |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | $path = $this->fullPath($folder); |
201 | 201 | $default = $this->settings->defaultIndex(); |
202 | 202 | |
203 | - if (! $this->chunksFilesystem()->exists($path) && $index != $default) { |
|
203 | + if (!$this->chunksFilesystem()->exists($path) && $index != $default) { |
|
204 | 204 | return false; |
205 | 205 | } elseif ($this->chunksFilesystem()->exists($path)) { |
206 | 206 | if (ChunkySettings::INDEX_ZERO != $default) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | |
210 | 210 | return count($this->chunksFilesystem()->files($path)) == $index; |
211 | 211 | } elseif ($index == $default) { |
212 | - if (! $this->chunksFilesystem()->makeDirectory($path)) { |
|
212 | + if (!$this->chunksFilesystem()->makeDirectory($path)) { |
|
213 | 213 | throw new ChunksIntegrityException("Cannot create chunks folder $path"); |
214 | 214 | } |
215 | 215 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | public function addChunk(UploadedFile $file, int $index, string $folder): Chunk |
224 | 224 | { |
225 | 225 | // Check integrity |
226 | - if (! $this->checkChunkIntegrity($folder, $index)) { |
|
226 | + if (!$this->checkChunkIntegrity($folder, $index)) { |
|
227 | 227 | throw new ChunksIntegrityException("Uploaded chunk with index {$index} violates the integrity"); |
228 | 228 | } |
229 | 229 |
@@ -24,7 +24,7 @@ |
||
24 | 24 | { |
25 | 25 | $chunk = Arr::first($chunks); |
26 | 26 | |
27 | - if (! $this->manager->chunksFilesystem()->concatenate($chunk, ...$chunks)) { |
|
27 | + if (!$this->manager->chunksFilesystem()->concatenate($chunk, ...$chunks)) { |
|
28 | 28 | throw new StrategyException('Unable to concatenate chunks'); |
29 | 29 | } |
30 | 30 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | private function buildInstance(string $strategy, $manager = null) |
31 | 31 | { |
32 | - if (! method_exists($strategy, 'newInstance')) { |
|
32 | + if (!method_exists($strategy, 'newInstance')) { |
|
33 | 33 | throw new StrategyException('Cannot instantiate strategy instance'); |
34 | 34 | } |
35 | 35 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | */ |
42 | 42 | public function default($manager = null): MergeStrategy |
43 | 43 | { |
44 | - if (! Arr::has($this->config, 'default')) { |
|
44 | + if (!Arr::has($this->config, 'default')) { |
|
45 | 45 | throw new StrategyException('Undefined default strategy'); |
46 | 46 | } |
47 | 47 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | ->inFormat($this->guessFormat()) |
16 | 16 | ->concatWithoutTranscoding(); |
17 | 17 | |
18 | - if (! empty($visibility = $this->visibility())) { |
|
18 | + if (!empty($visibility = $this->visibility())) { |
|
19 | 19 | $exporter->withVisibility($visibility); |
20 | 20 | } |
21 | 21 |
@@ -62,7 +62,7 @@ |
||
62 | 62 | $this->request->fileInput()->getMimeType() |
63 | 63 | ); |
64 | 64 | |
65 | - if (! $handler->checkIntegrity($this->request->chunkSizeInput(), $this->request->totalSizeInput())) { |
|
65 | + if (!$handler->checkIntegrity($this->request->chunkSizeInput(), $this->request->totalSizeInput())) { |
|
66 | 66 | throw new ChunksIntegrityException('Chunks total file size doesnt match with original file size'); |
67 | 67 | } |
68 | 68 |