Test Failed
Push — master ( ba03f2...dee2b3 )
by Mostafa
58s queued 15s
created
src/Storage/FFMpeg/FFMpeg.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     private FFMpegMeta $meta;
33 33
 
34
-    private Video|Audio $media;
34
+    private Video | Audio $media;
35 35
 
36 36
 
37 37
     /**
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
     }
63 63
 
64 64
 
65
-    public function getMedia(): Video|Audio
65
+    public function getMedia(): Video | Audio
66 66
     {
67 67
         return $this->media;
68 68
     }
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
         return $this;
101 101
     }
102 102
 
103
-    public function capture(int|float|null $fromSeconds, ImageStyle $style, string $saveTo, bool $withDominantColor = false): ?string
103
+    public function capture(int | float | null $fromSeconds, ImageStyle $style, string $saveTo, bool $withDominantColor = false): ?string
104 104
     {
105 105
         $dominantColor = null;
106 106
         $saveTo = get_larupload_save_path($this->disk, $saveTo);
@@ -141,7 +141,7 @@  discard block
 block discarded – undo
141 141
         return $hls->export($styles, $basePath, $fileName);
142 142
     }
143 143
 
144
-    public function resize(VideoStyle|ImageStyle|StreamStyle $style): void
144
+    public function resize(VideoStyle | ImageStyle | StreamStyle $style): void
145 145
     {
146 146
         $dimension = $this->dimension($style);
147 147
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         }
158 158
     }
159 159
 
160
-    public function crop(VideoStyle|ImageStyle|StreamStyle $style): void
160
+    public function crop(VideoStyle | ImageStyle | StreamStyle $style): void
161 161
     {
162 162
         $meta = $this->getMeta();
163 163
         $width = $style->width ?? null;
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         }
179 179
     }
180 180
 
181
-    private function frame(int|float|null $fromSeconds, array $saveTo): void
181
+    private function frame(int | float | null $fromSeconds, array $saveTo): void
182 182
     {
183 183
         if (is_null($fromSeconds)) {
184 184
             $fromSeconds = $this->getMeta()->duration / 2;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 
187 187
         $saveToPath = $saveTo['local'];
188 188
         $commands = [
189
-            '-y', '-ss', (string)TimeCode::fromSeconds($fromSeconds),
189
+            '-y', '-ss', (string) TimeCode::fromSeconds($fromSeconds),
190 190
             '-i', $this->media->getPathfile(),
191 191
             '-vframes', '1',
192 192
             '-f', 'image2',
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
         return Log::channel($channel ?: config('logging.default'));
236 236
     }
237 237
 
238
-    private function dimension(VideoStyle|ImageStyle|StreamStyle $style): Dimension
238
+    private function dimension(VideoStyle | ImageStyle | StreamStyle $style): Dimension
239 239
     {
240 240
         $width = $style->width ?: (!$style->height ? self::DEFAULT_SCALE : 1);
241 241
         $height = $style->height ?: (!$style->width ? self::DEFAULT_SCALE : 1);
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -147,8 +147,7 @@  discard block
 block discarded – undo
147 147
 
148 148
         if ($style->padding) {
149 149
             $this->media->filters()->pad($dimension)->synchronize();
150
-        }
151
-        else {
150
+        } else {
152 151
             $mode = $style->mode->ffmpegResizeFilter() ?? ResizeFilter::RESIZEMODE_SCALE_HEIGHT;
153 152
 
154 153
             $this->media->filters()
@@ -167,8 +166,7 @@  discard block
 block discarded – undo
167 166
 
168 167
         if ($width and $height) {
169 168
             $this->media->filters()->custom("scale=$scaleType,crop=$width:$height,setsar=1");
170
-        }
171
-        else {
169
+        } else {
172 170
             /**
173 171
              * With new validation rules in Video/Image/Stream style, this code will never happen
174 172
              */
@@ -201,8 +199,7 @@  discard block
 block discarded – undo
201 199
 
202 200
         try {
203 201
             $this->media->getFFMpegDriver()->command($commands);
204
-        }
205
-        catch (ExecutionFailureException $e) {
202
+        } catch (ExecutionFailureException $e) {
206 203
             if (file_exists($saveToPath) && is_writable($saveToPath)) {
207 204
                 // @codeCoverageIgnoreStart
208 205
                 @unlink($saveToPath);
Please login to merge, or discard this patch.
src/Storage/Proxy/AttachmentProxy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         return new AttachmentCover($this->attachment);
28 28
     }
29 29
 
30
-    public function meta(string $key = null): object|int|string|null
30
+    public function meta(string $key = null): object | int | string | null
31 31
     {
32 32
         return $this->attachment->meta($key);
33 33
     }
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         return $this->attachment->url($style);
43 43
     }
44 44
 
45
-    public function download(string $style = Larupload::ORIGINAL_FOLDER): StreamedResponse|RedirectResponse|null
45
+    public function download(string $style = Larupload::ORIGINAL_FOLDER): StreamedResponse | RedirectResponse | null
46 46
     {
47 47
         return $this->attachment->download($style);
48 48
     }
Please login to merge, or discard this patch.
src/Actions/GuessLaruploadFileTypeAction.php 1 patch
Braces   +4 added lines, -8 removed lines patch added patch discarded remove patch
@@ -35,17 +35,13 @@
 block discarded – undo
35 35
     {
36 36
         if (str_contains($mime, 'image/')) {
37 37
             return LaruploadFileType::IMAGE;
38
-        }
39
-        else if (str_contains($mime, 'video/')) {
38
+        } else if (str_contains($mime, 'video/')) {
40 39
             return LaruploadFileType::VIDEO;
41
-        }
42
-        else if (str_contains($mime, 'audio/')) {
40
+        } else if (str_contains($mime, 'audio/')) {
43 41
             return LaruploadFileType::AUDIO;
44
-        }
45
-        else if ($this->isDocument($mime)) {
42
+        } else if ($this->isDocument($mime)) {
46 43
             return LaruploadFileType::DOCUMENT;
47
-        }
48
-        else if ($this->isCompressed($mime)) {
44
+        } else if ($this->isCompressed($mime)) {
49 45
             return LaruploadFileType::COMPRESSED;
50 46
         }
51 47
 
Please login to merge, or discard this patch.
src/Actions/Cover/SetCoverAction.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -29,11 +29,9 @@
 block discarded – undo
29 29
 
30 30
         if ($this->shouldDeleteCover()) {
31 31
             $output = DeleteCoverAction::make($this->data->type, $output)->run();
32
-        }
33
-        else if ($this->shouldUploadCover()) {
32
+        } else if ($this->shouldUploadCover()) {
34 33
             $output = UploadCoverAction::make($this->cover, $this->data)->run($path);
35
-        }
36
-        else if ($this->data->generateCover) {
34
+        } else if ($this->data->generateCover) {
37 35
             $output = GenerateCoverFromFileAction::make($this->file, $this->data)->run($path);
38 36
         }
39 37
 
Please login to merge, or discard this patch.
src/Actions/GenerateFileIdAction.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@
 block discarded – undo
36 36
         };
37 37
     }
38 38
 
39
-    private function retrieveCurrentSecureId(): string|null
39
+    private function retrieveCurrentSecureId(): string | null
40 40
     {
41 41
         if ($this->attachmentMode === LaruploadMode::HEAVY) {
42 42
             return $this->model->{"{$this->attachmentName}_file_id"} ?? null;
Please login to merge, or discard this patch.
src/Helpers/Utils.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -37,8 +37,7 @@  discard block
 block discarded – undo
37 37
         // @codeCoverageIgnoreStart
38 38
         if (ini_get('upload_tmp_dir')) {
39 39
             $path = ini_get('upload_tmp_dir');
40
-        }
41
-        else if (getenv('temp')) {
40
+        } else if (getenv('temp')) {
42 41
             $path = getenv('temp');
43 42
         }
44 43
         // @codeCoverageIgnoreEnd
@@ -81,8 +80,7 @@  discard block
 block discarded – undo
81 80
 
82 81
         if (disk_driver_is_local($disk)) {
83 82
             $temp = null;
84
-        }
85
-        else {
83
+        } else {
86 84
             $tempDir = larupload_temp_dir();
87 85
             $tempName = \Illuminate\Support\Carbon::now()->unix() . '-' . $name;
88 86
             $temp = "$tempDir/$tempName";
@@ -135,8 +133,7 @@  discard block
 block discarded – undo
135 133
                 }
136 134
 
137 135
                 @rmdir($path);
138
-            }
139
-            else {
136
+            } else {
140 137
                 $file = new \Symfony\Component\HttpFoundation\File\File($saveTo['temp']);
141 138
 
142 139
                 \Illuminate\Support\Facades\Storage::disk($disk)->putFileAs(
Please login to merge, or discard this patch.
src/Database/Schema/Blueprint.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -32,8 +32,7 @@  discard block
 block discarded – undo
32 32
             $table->string("{$name}_file_dominant_color", 7)->nullable();
33 33
             $table->string("{$name}_file_format", 85)->nullable();
34 34
             $table->string("{$name}_file_cover", 85)->nullable();
35
-        }
36
-        else {
35
+        } else {
37 36
             $table->{self::jsonColumnType()}("{$name}_file_meta")->nullable();
38 37
         }
39 38
     }
@@ -65,8 +64,7 @@  discard block
 block discarded – undo
65 64
             $table->dropIndex("{$tableName}_{$name}_file_size_index");
66 65
             $table->dropIndex("{$tableName}_{$name}_file_type_index");
67 66
             $table->dropIndex("{$tableName}_{$name}_file_duration_index");
68
-        }
69
-        else {
67
+        } else {
70 68
             $columns[] = "{$name}_file_meta";
71 69
         }
72 70
 
Please login to merge, or discard this patch.
src/DTOs/Style/VideoStyle.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -32,22 +32,19 @@
 block discarded – undo
32 32
                     'Width is required when you are in SCALE_HEIGHT mode'
33 33
                 );
34 34
             }
35
-        }
36
-        else if ($this->mode === LaruploadMediaStyle::SCALE_WIDTH) {
35
+        } else if ($this->mode === LaruploadMediaStyle::SCALE_WIDTH) {
37 36
             if ($this->height === null or $this->height === 0) {
38 37
                 throw new Exception(
39 38
                     'Height is required when you are in SCALE_WIDTH mode'
40 39
                 );
41 40
             }
42
-        }
43
-        else if (in_array($this->mode, [LaruploadMediaStyle::CROP, LaruploadMediaStyle::FIT])) {
41
+        } else if (in_array($this->mode, [LaruploadMediaStyle::CROP, LaruploadMediaStyle::FIT])) {
44 42
             if (!$this->width or !$this->height) {
45 43
                 throw new Exception(
46 44
                     'Width and Height are required when you are in CROP/FIT mode'
47 45
                 );
48 46
             }
49
-        }
50
-        else if ($this->mode === LaruploadMediaStyle::AUTO) {
47
+        } else if ($this->mode === LaruploadMediaStyle::AUTO) {
51 48
             if (!$this->width and !$this->height) {
52 49
                 throw new Exception(
53 50
                     'Width and height are required when you are in auto mode'
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/StyleAttachment.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@
 block discarded – undo
18 18
      * @param Model|string $class
19 19
      * @param bool $standalone
20 20
      */
21
-    protected function handleStyles(string $id, Model|string $model, bool $standalone = false): void
21
+    protected function handleStyles(string $id, Model | string $model, bool $standalone = false): void
22 22
     {
23 23
         switch ($this->type) {
24 24
             case LaruploadFileType::IMAGE:
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -42,14 +42,12 @@  discard block
 block discarded – undo
42 42
                         $this->initializeFFMpegQueue(
43 43
                             $model->id, $model->getMorphClass(), $standalone
44 44
                         );
45
-                    }
46
-                    else {
45
+                    } else {
47 46
                         $this->initializeFFMpegQueue(
48 47
                             $id, $model, $standalone
49 48
                         );
50 49
                     }
51
-                }
52
-                else {
50
+                } else {
53 51
                     $this->handleVideoStyles($id);
54 52
                 }
55 53
 
@@ -65,14 +63,12 @@  discard block
 block discarded – undo
65 63
                         $this->initializeFFMpegQueue(
66 64
                             $model->id, $model->getMorphClass(), $standalone
67 65
                         );
68
-                    }
69
-                    else {
66
+                    } else {
70 67
                         $this->initializeFFMpegQueue(
71 68
                             $id, $model, $standalone
72 69
                         );
73 70
                     }
74
-                }
75
-                else {
71
+                } else {
76 72
                     $this->handleAudioStyles($id);
77 73
                 }
78 74
 
@@ -154,8 +150,7 @@  discard block
 block discarded – undo
154 150
                 }
155 151
 
156 152
                 return null;
157
-            }
158
-            else if ($name and $this->styleHasFile($style)) {
153
+            } else if ($name and $this->styleHasFile($style)) {
159 154
 
160 155
                 $name = FixExceptionNamesAction::make($name, $style, $this->getStyle($style))->run();
161 156
                 $path = $this->getBasePath($this->id, $style);
Please login to merge, or discard this patch.