Test Failed
Pull Request — master (#24)
by Filippo
12:43
created
src/Http/Requests/AddChunkRequest.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -107,7 +107,7 @@
 block discarded – undo
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
             ) {
Please login to merge, or discard this patch.
src/Strategies/Concerns/HandlesFFMpeg.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/ChunkySettings.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
 
60 60
         if ($folder === null) {
61 61
             return '';
62
-        } elseif (! Str::endsWith($folder, '/')) {
62
+        } elseif (!Str::endsWith($folder, '/')) {
63 63
             $folder .= DIRECTORY_SEPARATOR;
64 64
         }
65 65
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
         if ($folder === null) {
89 89
             return '';
90
-        } elseif (! Str::endsWith($folder, '/')) {
90
+        } elseif (!Str::endsWith($folder, '/')) {
91 91
             $folder .= DIRECTORY_SEPARATOR;
92 92
         }
93 93
 
Please login to merge, or discard this patch.
src/Strategies/MergeStrategy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
      */
66 66
     public function destination($destination = null): string
67 67
     {
68
-        if (is_string($destination) && ! empty($destination)) {
68
+        if (is_string($destination) && !empty($destination)) {
69 69
             $this->destination = $this->mergeManager->destinationPath($destination);
70 70
         }
71 71
 
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     {
80 80
         if (is_string($folder) && $this->chunksManager->validFolder($folder)) {
81 81
             $this->folder = $folder;
82
-        } elseif (empty($this->folder) || ! $this->chunksManager->validFolder($this->folder)) {
82
+        } elseif (empty($this->folder) || !$this->chunksManager->validFolder($this->folder)) {
83 83
             throw new StrategyException('Chunks folder cannot be empty');
84 84
         }
85 85
 
Please login to merge, or discard this patch.
src/Strategies/StrategyFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
      */
31 31
     private function buildInstance(string $strategy)
32 32
     {
33
-        if (! method_exists($strategy, 'instance')) {
33
+        if (!method_exists($strategy, 'instance')) {
34 34
             throw new StrategyException('Cannot instantiate strategy instance');
35 35
         }
36 36
 
Please login to merge, or discard this patch.
src/Strategies/FlysystemStrategy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
      */
12 12
     protected function mergeChunks(string $destination, array $chunks): bool
13 13
     {
14
-        if (! $this->chunksManager->chunksFilesystem()->concatenate($destination, $chunks)) {
14
+        if (!$this->chunksManager->chunksFilesystem()->concatenate($destination, $chunks)) {
15 15
             throw new StrategyException('Unable to concatenate chunks');
16 16
         }
17 17
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->mergeManager->getMergeOptions()
43 43
         );
44 44
 
45
-        if (! $path) {
45
+        if (!$path) {
46 46
             throw new StrategyException('An error occurred while moving merge to destination');
47 47
         }
48 48
 
Please login to merge, or discard this patch.
src/ChunkyServiceProvider.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -68,18 +68,18 @@
 block discarded – undo
68 68
         $this->app->bind(ChunksFilesystem::class, ChunksFilesystem::class);
69 69
         $this->app->bind(MergeFilesystem::class, MergeFilesystem::class);
70 70
 
71
-        $this->app->singleton(ChunksManagerContract::class, function (Container $app) {
71
+        $this->app->singleton(ChunksManagerContract::class, function(Container $app) {
72 72
             return new ChunksManager(new ChunkySettings(
73 73
                 $app->make('config')
74 74
             ));
75 75
         });
76
-        $this->app->singleton(MergeManagerContract::class, function (Container $app) {
76
+        $this->app->singleton(MergeManagerContract::class, function(Container $app) {
77 77
             return new MergeManager(new ChunkySettings(
78 78
                 $app->make('config')
79 79
             ));
80 80
         });
81 81
 
82
-        $this->app->singleton(StrategyFactoryContract::class, function (Container $app) {
82
+        $this->app->singleton(StrategyFactoryContract::class, function(Container $app) {
83 83
             return new StrategyFactory(new ChunkySettings(
84 84
                 $app->make('config')
85 85
             ));
Please login to merge, or discard this patch.
src/Support/ChunksFilesystem.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     /** {@inheritdoc} */
40 40
     public function disk($disk = null): ?string
41 41
     {
42
-        if (! empty($disk) && is_string($disk)) {
42
+        if (!empty($disk) && is_string($disk)) {
43 43
             $this->disk = $disk;
44 44
         }
45 45
 
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
     /** {@inheritdoc} */
50 50
     public function folder($folder = null): ?string
51 51
     {
52
-        if (! empty($folder) && is_string($folder)) {
52
+        if (!empty($folder) && is_string($folder)) {
53 53
             $this->folder = $folder;
54 54
         }
55 55
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 
68 68
         if (Str::startsWith($folder, $this->folder)) {
69 69
             return $folder.$suffix;
70
-        } else if(!Str::endsWith($this->folder, $folder.$suffix)) {
70
+        } else if (!Str::endsWith($this->folder, $folder.$suffix)) {
71 71
             return $this->folder.$folder.$suffix;
72 72
         }
73 73
 
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
      */
110 110
     public function store(Chunk $chunk, string $folder, $options = []): Chunk
111 111
     {
112
-        if (! $chunk->getOriginalPath() instanceof File) {
112
+        if (!$chunk->getOriginalPath() instanceof File) {
113 113
             throw new ChunkyException('Path must be a file');
114 114
         }
115 115
 
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 
145 145
         $folder = $this->fullPath($folder);
146 146
 
147
-        if (! $this->filesystem()->disk($this->disk)->exists($folder)) {
147
+        if (!$this->filesystem()->disk($this->disk)->exists($folder)) {
148 148
             return true;
149 149
         }
150 150
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
      */
166 166
     public function deleteChunk(Chunk $chunk): bool
167 167
     {
168
-        if (! $this->filesystem()->disk($this->disk)->exists($chunk->getPath())) {
168
+        if (!$this->filesystem()->disk($this->disk)->exists($chunk->getPath())) {
169 169
             return true;
170 170
         }
171 171
 
@@ -190,14 +190,14 @@  discard block
 block discarded – undo
190 190
         $files = $this->list($folder);
191 191
 
192 192
         return collect($files)
193
-            ->map(function ($path, $key) use ($folder, $files) {
193
+            ->map(function($path, $key) use ($folder, $files) {
194 194
                 $filename = str_replace($folder, '', $path);
195 195
                 $exploded_name = explode('_', $filename);
196 196
                 $index = array_shift($exploded_name);
197 197
                 $last = count($files) - 1 == $key;
198 198
 
199 199
                 return new Chunk(intval($index), $path, $this->disk, $last);
200
-            })->sortBy(function (Chunk $chunk) {
200
+            })->sortBy(function(Chunk $chunk) {
201 201
                 return $chunk->getIndex();
202 202
             });
203 203
     }
@@ -250,13 +250,13 @@  discard block
 block discarded – undo
250 250
     {
251 251
         $this->addTemporaryContext($folder);
252 252
 
253
-        return $chunks->map(function (Chunk $chunk) use ($folder) {
253
+        return $chunks->map(function(Chunk $chunk) use ($folder) {
254 254
             $resource = $this->filesystem()->disk($this->disk)->readStream($chunk->getPath());
255 255
             $location = $this->temporaryFilesystem()->createTemporaryFile($folder);
256 256
 
257 257
             $stream = fopen($location, 'w+b');
258 258
 
259
-            if (! $stream || stream_copy_to_stream($resource, $stream) === false || ! fclose($stream)) {
259
+            if (!$stream || stream_copy_to_stream($resource, $stream) === false || !fclose($stream)) {
260 260
                 return false;
261 261
             }
262 262
 
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
         $stream = new AppendStream;
278 278
 
279 279
         foreach ($chunks as $chunk) {
280
-            if(!$this->isLocal()) {
280
+            if (!$this->isLocal()) {
281 281
                 $temp = fopen($chunk, 'rb');
282 282
                 $stream->append($temp);
283 283
             } else {
@@ -285,7 +285,7 @@  discard block
 block discarded – undo
285 285
             }
286 286
         }
287 287
 
288
-        if(!$this->isLocal()) {
288
+        if (!$this->isLocal()) {
289 289
             file_put_contents($first, $stream->getResource());
290 290
             return $this->filesystem()->disk($this->disk)->put($destination, fopen($first, 'rb'));
291 291
         }
Please login to merge, or discard this patch.
src/Support/MergeFilesystem.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
     /** {@inheritdoc} */
10 10
     public function disk($disk = null): ?string
11 11
     {
12
-        if (! empty($disk) && is_string($disk)) {
12
+        if (!empty($disk) && is_string($disk)) {
13 13
             $this->disk = $disk;
14 14
         }
15 15
 
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     /** {@inheritdoc} */
20 20
     public function folder($folder = null): ?string
21 21
     {
22
-        if (! empty($folder) && is_string($folder)) {
22
+        if (!empty($folder) && is_string($folder)) {
23 23
             $this->folder = $folder;
24 24
         }
25 25
 
Please login to merge, or discard this patch.