Test Failed
Branch master (df1c42)
by Mostafa
15:23
created
src/DTOs/Style/ImageStyle.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/DTOs/Style/VideoStyle.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -35,22 +35,19 @@
 block discarded – undo
35 35
                     'Width is required when you are in SCALE_HEIGHT mode'
36 36
                 );
37 37
             }
38
-        }
39
-        else if ($this->mode === LaruploadMediaStyle::SCALE_WIDTH) {
38
+        } else if ($this->mode === LaruploadMediaStyle::SCALE_WIDTH) {
40 39
             if ($this->height === null or $this->height === 0) {
41 40
                 throw new Exception(
42 41
                     'Height is required when you are in SCALE_WIDTH mode'
43 42
                 );
44 43
             }
45
-        }
46
-        else if (in_array($this->mode, [LaruploadMediaStyle::CROP, LaruploadMediaStyle::FIT])) {
44
+        } else if (in_array($this->mode, [LaruploadMediaStyle::CROP, LaruploadMediaStyle::FIT])) {
47 45
             if (!$this->width or !$this->height) {
48 46
                 throw new Exception(
49 47
                     'Width and Height are required when you are in CROP/FIT mode'
50 48
                 );
51 49
             }
52
-        }
53
-        else if ($this->mode === LaruploadMediaStyle::AUTO) {
50
+        } else if ($this->mode === LaruploadMediaStyle::AUTO) {
54 51
             if (!$this->width and !$this->height) {
55 52
                 throw new Exception(
56 53
                     'Width and height are required when you are in auto mode'
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/BaseAttachment.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -74,9 +74,9 @@
 block discarded – undo
74 74
     {
75 75
         Storage::disk($disk ?: $this->disk)
76 76
             ->putFileAs(
77
-                path: $this->getBasePath($id, Larupload::ORIGINAL_FOLDER),
78
-                file: $this->file,
79
-                name: $this->output['name']
77
+                path : $this->getBasePath($id, Larupload::ORIGINAL_FOLDER),
78
+                file : $this->file,
79
+                name : $this->output['name']
80 80
             );
81 81
     }
82 82
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
58 58
             foreach ($this->output as $key => $value) {
59 59
                 $model->{"{$this->name}_file_$key"} = $value;
60 60
             }
61
-        }
62
-        else {
61
+        } else {
63 62
             $model->{"{$this->name}_file_name"} = $this->output['name'] ?? null;
64 63
             $model->{"{$this->name}_file_meta"} = json_encode($this->output);
65 64
         }
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/AttachmentEvents.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,8 +17,7 @@  discard block
 block discarded – undo
17 17
         if (isset($this->file)) {
18 18
             if ($this->file == LARUPLOAD_NULL) {
19 19
                 $this->clean($this->id);
20
-            }
21
-            else {
20
+            } else {
22 21
                 if (!$this->keepOldFiles) {
23 22
                     $this->clean($this->id);
24 23
                 }
@@ -31,8 +30,7 @@  discard block
 block discarded – undo
31 30
             }
32 31
 
33 32
             $model = $this->setAttributes($model);
34
-        }
35
-        else if (isset($this->cover)) {
33
+        } else if (isset($this->cover)) {
36 34
             $this->setCover($this->id);
37 35
 
38 36
             $model = $this->setAttributes($model);
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/RetrieveAttachment.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
      * @param string|null $key
17 17
      * @return object|string|integer|null
18 18
      */
19
-    public function meta(string $key = null): object|int|string|null
19
+    public function meta(string $key = null): object | int | string | null
20 20
     {
21 21
         if ($key) {
22 22
             $meta = $this->output;
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      * @param string $style
91 91
      * @return RedirectResponse|StreamedResponse|null
92 92
      */
93
-    public function download(string $style = Larupload::ORIGINAL_FOLDER): StreamedResponse|RedirectResponse|null
93
+    public function download(string $style = Larupload::ORIGINAL_FOLDER): StreamedResponse | RedirectResponse | null
94 94
     {
95 95
         $path = $this->prepareStylePath($style);
96 96
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
             if ($style == Larupload::COVER_FOLDER and !$this->generateCover) {
51 51
                 $styles->{$style} = null;
52 52
                 continue;
53
-            }
54
-            else if ($style == Larupload::STREAM_FOLDER and empty($this->streams)) {
53
+            } else if ($style == Larupload::STREAM_FOLDER and empty($this->streams)) {
55 54
                 unset($styles->{$style});
56 55
                 continue;
57 56
             }
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/QueueAttachment.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
         if ($maxQueueNum == 0) {
40 40
             $flag = true;
41
-        }
42
-        else {
41
+        } else {
43 42
             $availableQueues = DB::table(Larupload::FFMPEG_QUEUE_TABLE)
44 43
                 ->where('status', 0)
45 44
                 ->count();
@@ -76,8 +75,7 @@  discard block
 block discarded – undo
76 75
 
77 76
 
78 77
             ProcessFFMpeg::dispatch($queueId, $id, $this->name, $class, $serializedClass);
79
-        }
80
-        else {
78
+        } else {
81 79
             throw new HttpResponseException(redirect(URL::previous())->withErrors([
82 80
                 'ffmpeg_queue_max_num' => trans('larupload::messages.max-queue-num-exceeded')
83 81
             ]));
Please login to merge, or discard this patch.
src/Concerns/Storage/Attachment/StyleAttachment.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,8 +38,7 @@  discard block
 block discarded – undo
38 38
                     }
39 39
 
40 40
                     $this->initializeFFMpegQueue($id, $class, $standalone);
41
-                }
42
-                else {
41
+                } else {
43 42
                     $this->handleVideoStyles($id);
44 43
                 }
45 44
 
@@ -105,8 +104,7 @@  discard block
 block discarded – undo
105 104
                 }
106 105
 
107 106
                 return null;
108
-            }
109
-            else if ($name and $this->styleHasFile($style)) {
107
+            } else if ($name and $this->styleHasFile($style)) {
110 108
                 $name = FixExceptionNamesAction::make($name, $style)->run();
111 109
                 $path = $this->getBasePath($this->id, $style);
112 110
 
Please login to merge, or discard this patch.
src/Concerns/Storage/UploadEntity/UploadEntityResponse.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@
 block discarded – undo
49 49
         return $path;
50 50
     }
51 51
 
52
-    protected function storageDownload(string $path): StreamedResponse|RedirectResponse|null
52
+    protected function storageDownload(string $path): StreamedResponse | RedirectResponse | null
53 53
     {
54 54
         if (isset($this->file) and $this->file == LARUPLOAD_NULL) {
55 55
             return null;
Please login to merge, or discard this patch.
src/Concerns/Storage/UploadEntity/BaseUploadEntity.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@
 block discarded – undo
75 75
      */
76 76
     protected function outputToObject(): object
77 77
     {
78
-        $output = (object)$this->output;
78
+        $output = (object) $this->output;
79 79
 
80 80
         if ($this->camelCaseResponse) {
81 81
             $output->mimeType = $output->mime_type;
Please login to merge, or discard this patch.