@@ -122,15 +122,15 @@  | 
                                                    ||
| 122 | 122 | |
| 123 | 123 |                      foreach ($output->streams as $stream) { | 
                                                        
| 124 | 124 |                          if (isset($stream->width)) { | 
                                                        
| 125 | - $meta['width'] = (int)$stream->width;  | 
                                                        |
| 125 | + $meta['width'] = (int) $stream->width;  | 
                                                        |
| 126 | 126 | }  | 
                                                        
| 127 | 127 | |
| 128 | 128 |                          if (isset($stream->height)) { | 
                                                        
| 129 | - $meta['height'] = (int)$stream->height;  | 
                                                        |
| 129 | + $meta['height'] = (int) $stream->height;  | 
                                                        |
| 130 | 130 | }  | 
                                                        
| 131 | 131 | |
| 132 | 132 |                          if (isset($stream->duration)) { | 
                                                        
| 133 | - $meta['duration'] = (int)$stream->duration;  | 
                                                        |
| 133 | + $meta['duration'] = (int) $stream->duration;  | 
                                                        |
| 134 | 134 | }  | 
                                                        
| 135 | 135 | |
| 136 | 136 |                          if (isset($stream->tags->rotate)) { | 
                                                        
@@ -142,13 +142,11 @@ discard block  | 
                                                    ||
| 142 | 142 |                      if ($rotate == 90 or $rotate == 270) { | 
                                                        
| 143 | 143 | list($meta['height'], $meta['width']) = array($meta['width'], $meta['height']);  | 
                                                        
| 144 | 144 | }  | 
                                                        
| 145 | - }  | 
                                                        |
| 146 | -                else { | 
                                                        |
| 145 | +                } else { | 
                                                        |
| 147 | 146 |                      $process->addErrorOutput('ffprobe output is null'); | 
                                                        
| 148 | 147 | throw new Exception($process->getErrorOutput());  | 
                                                        
| 149 | 148 | }  | 
                                                        
| 150 | - }  | 
                                                        |
| 151 | -            else { | 
                                                        |
| 149 | +            } else { | 
                                                        |
| 152 | 150 | throw new Exception($process->getErrorOutput());  | 
                                                        
| 153 | 151 | }  | 
                                                        
| 154 | 152 | |
@@ -187,12 +185,10 @@ discard block  | 
                                                    ||
| 187 | 185 |          if ($mode == LaruploadEnum::CROP_STYLE_MODE) { | 
                                                        
| 188 | 186 |              if ($width and $height) { | 
                                                        
| 189 | 187 |                  $cmd = escapeshellcmd("$this->ffmpeg -ss $fromSecond -i $path -vframes 1 -filter scale=$scaleType,crop=$width:$height"); | 
                                                        
| 190 | - }  | 
                                                        |
| 191 | -            else { | 
                                                        |
| 188 | +            } else { | 
                                                        |
| 192 | 189 |                  $cmd = escapeshellcmd("$this->ffmpeg -ss $fromSecond -i $path -vframes 1 -filter scale=$scaleType,crop=$scale:$scale"); | 
                                                        
| 193 | 190 | }  | 
                                                        
| 194 | - }  | 
                                                        |
| 195 | -        else { | 
                                                        |
| 191 | +        } else { | 
                                                        |
| 196 | 192 |              $cmd = escapeshellcmd("$this->ffmpeg -ss $fromSecond -i $path -vframes 1 -filter scale=$scaleType"); | 
                                                        
| 197 | 193 | }  | 
                                                        
| 198 | 194 | |
@@ -218,12 +214,10 @@ discard block  | 
                                                    ||
| 218 | 214 |          if ($mode == LaruploadEnum::CROP_STYLE_MODE) { | 
                                                        
| 219 | 215 |              if ($scale) { | 
                                                        
| 220 | 216 |                  $cmd = escapeshellcmd("$this->ffmpeg -i $path -vf scale=$scale,crop=$width:$height,setsar=1"); | 
                                                        
| 221 | - }  | 
                                                        |
| 222 | -            else { | 
                                                        |
| 217 | +            } else { | 
                                                        |
| 223 | 218 |                  $cmd = escapeshellcmd("$this->ffmpeg -i $path -vf crop=$width:$height,setsar=1"); | 
                                                        
| 224 | 219 | }  | 
                                                        
| 225 | - }  | 
                                                        |
| 226 | -        else { | 
                                                        |
| 220 | +        } else { | 
                                                        |
| 227 | 221 |              $cmd = escapeshellcmd("$this->ffmpeg -i $path -vf scale=$scale,setsar=1"); | 
                                                        
| 228 | 222 | }  | 
                                                        
| 229 | 223 | |
@@ -317,8 +311,7 @@ discard block  | 
                                                    ||
| 317 | 311 | }  | 
                                                        
| 318 | 312 | |
| 319 | 313 | $scale = "$scale:-2";  | 
                                                        
| 320 | - }  | 
                                                        |
| 321 | -                else { | 
                                                        |
| 314 | +                } else { | 
                                                        |
| 322 | 315 | $scale = ceil(($meta['height'] * $width) / $meta['width']);  | 
                                                        
| 323 | 316 | |
| 324 | 317 |                      if ($scale < $height) { | 
                                                        
@@ -327,12 +320,10 @@ discard block  | 
                                                    ||
| 327 | 320 | |
| 328 | 321 | $scale = "-2:$scale";  | 
                                                        
| 329 | 322 | }  | 
                                                        
| 330 | - }  | 
                                                        |
| 331 | -            else { | 
                                                        |
| 323 | +            } else { | 
                                                        |
| 332 | 324 | $scale = '';  | 
                                                        
| 333 | 325 | }  | 
                                                        
| 334 | - }  | 
                                                        |
| 335 | -        else { | 
                                                        |
| 326 | +        } else { | 
                                                        |
| 336 | 327 | $scale = $width ? "$width:-2" : ($height ? "-2:$height" : (self::DEFAULT_SCALE . ':-2'));  | 
                                                        
| 337 | 328 | }  | 
                                                        
| 338 | 329 | |
@@ -366,8 +357,7 @@ discard block  | 
                                                    ||
| 366 | 357 | }  | 
                                                        
| 367 | 358 | |
| 368 | 359 | throw new Exception($process->getErrorOutput());  | 
                                                        
| 369 | - }  | 
                                                        |
| 370 | -        else { | 
                                                        |
| 360 | +        } else { | 
                                                        |
| 371 | 361 | list($path, $name) = $this->splitPath($saveTo);  | 
                                                        
| 372 | 362 | |
| 373 | 363 | $tempDir = $this->tempDir();  | 
                                                        
@@ -418,8 +408,7 @@ discard block  | 
                                                    ||
| 418 | 408 | }  | 
                                                        
| 419 | 409 | |
| 420 | 410 | throw new Exception($process->getErrorOutput());  | 
                                                        
| 421 | - }  | 
                                                        |
| 422 | -        else { | 
                                                        |
| 411 | +        } else { | 
                                                        |
| 423 | 412 | $name = basename($streamPath);  | 
                                                        
| 424 | 413 | $temp = $name . '-' . time();  | 
                                                        
| 425 | 414 | |
@@ -92,8 +92,8 @@  | 
                                                    ||
| 92 | 92 | $size = $this->image->getSize();  | 
                                                        
| 93 | 93 | |
| 94 | 94 | return [  | 
                                                        
| 95 | - 'width' => (int)$size->getWidth(),  | 
                                                        |
| 96 | - 'height' => (int)$size->getHeight(),  | 
                                                        |
| 95 | + 'width' => (int) $size->getWidth(),  | 
                                                        |
| 96 | + 'height' => (int) $size->getHeight(),  | 
                                                        |
| 97 | 97 | ];  | 
                                                        
| 98 | 98 | }  | 
                                                        
| 99 | 99 | |
@@ -117,8 +117,7 @@ discard block  | 
                                                    ||
| 117 | 117 | |
| 118 | 118 |          if ($this->driverIsLocal) { | 
                                                        
| 119 | 119 | $this->$method($image, $width, $height)->save($saveTo);  | 
                                                        
| 120 | - }  | 
                                                        |
| 121 | -        else { | 
                                                        |
| 120 | +        } else { | 
                                                        |
| 122 | 121 | list($path, $name) = $this->splitPath($saveTo);  | 
                                                        
| 123 | 122 | |
| 124 | 123 | $tempDir = $this->tempDir();  | 
                                                        
@@ -361,8 +360,7 @@ discard block  | 
                                                    ||
| 361 | 360 | |
| 362 | 361 |              if ($file instanceof UploadedFile) { | 
                                                        
| 363 | 362 | $path = $file->getRealPath();  | 
                                                        
| 364 | - }  | 
                                                        |
| 365 | -            else if (file_exists($file)) { | 
                                                        |
| 363 | +            } else if (file_exists($file)) { | 
                                                        |
| 366 | 364 | $path = $file;  | 
                                                        
| 367 | 365 | }  | 
                                                        
| 368 | 366 | |
@@ -372,8 +370,7 @@ discard block  | 
                                                    ||
| 372 | 370 | return self::toHexString($color);  | 
                                                        
| 373 | 371 | }  | 
                                                        
| 374 | 372 | }  | 
                                                        
| 375 | - }  | 
                                                        |
| 376 | -        catch (Exception) { | 
                                                        |
| 373 | +        } catch (Exception) { | 
                                                        |
| 377 | 374 | // do nothing  | 
                                                        
| 378 | 375 | }  | 
                                                        
| 379 | 376 | |
@@ -121,8 +121,7 @@ discard block  | 
                                                    ||
| 121 | 121 |      { | 
                                                        
| 122 | 122 |          if ($attachment = $this->getAttachment($key)) { | 
                                                        
| 123 | 123 | $attachment->attach($value);  | 
                                                        
| 124 | - }  | 
                                                        |
| 125 | -        else { | 
                                                        |
| 124 | +        } else { | 
                                                        |
| 126 | 125 | parent::setAttribute($key, $value);  | 
                                                        
| 127 | 126 | }  | 
                                                        
| 128 | 127 | }  | 
                                                        
@@ -156,8 +155,7 @@ discard block  | 
                                                    ||
| 156 | 155 | }  | 
                                                        
| 157 | 156 | |
| 158 | 157 | return null;  | 
                                                        
| 159 | - }  | 
                                                        |
| 160 | -        else { | 
                                                        |
| 158 | +        } else { | 
                                                        |
| 161 | 159 | $attachments = new stdClass();  | 
                                                        
| 162 | 160 |              foreach ($this->attachments as $attachment) { | 
                                                        
| 163 | 161 |                  $attachments->{$attachment->getName()} = $attachment->urls(); | 
                                                        
@@ -208,8 +206,7 @@ discard block  | 
                                                    ||
| 208 | 206 |                      unset($array["{$name}_file_dominant_color"]); | 
                                                        
| 209 | 207 |                      unset($array["{$name}_file_format"]); | 
                                                        
| 210 | 208 |                      unset($array["{$name}_file_cover"]); | 
                                                        
| 211 | - }  | 
                                                        |
| 212 | -                else { | 
                                                        |
| 209 | +                } else { | 
                                                        |
| 213 | 210 |                      unset($array["{$name}_file_meta"]); | 
                                                        
| 214 | 211 | }  | 
                                                        
| 215 | 212 | }  | 
                                                        
@@ -65,8 +65,7 @@  | 
                                                    ||
| 65 | 65 |      { | 
                                                        
| 66 | 66 |          if ($this->internalFunctionIsCallable) { | 
                                                        
| 67 | 67 | parent::handleFFMpegQueue($isLastOne);  | 
                                                        
| 68 | - }  | 
                                                        |
| 69 | -        else { | 
                                                        |
| 68 | +        } else { | 
                                                        |
| 70 | 69 | self::internalException();  | 
                                                        
| 71 | 70 | }  | 
                                                        
| 72 | 71 | }  | 
                                                        
@@ -33,7 +33,7 @@ discard block  | 
                                                    ||
| 33 | 33 | * @throws Exception  | 
                                                        
| 34 | 34 | * @internal  | 
                                                        
| 35 | 35 | */  | 
                                                        
| 36 | - public function meta(string $key = null): object|int|string|null  | 
                                                        |
| 36 | + public function meta(string $key = null): object | int | string | null  | 
                                                        |
| 37 | 37 |      { | 
                                                        
| 38 | 38 |          if ($this->internalFunctionIsCallable) { | 
                                                        
| 39 | 39 | return parent::meta($key);  | 
                                                        
@@ -141,7 +141,7 @@ discard block  | 
                                                    ||
| 141 | 141 | * @throws Exception  | 
                                                        
| 142 | 142 | * @internal  | 
                                                        
| 143 | 143 | */  | 
                                                        
| 144 | - public function download(string $style = 'original'): StreamedResponse|RedirectResponse|null  | 
                                                        |
| 144 | + public function download(string $style = 'original'): StreamedResponse | RedirectResponse | null  | 
                                                        |
| 145 | 145 |      { | 
                                                        
| 146 | 146 | self::internalException();  | 
                                                        
| 147 | 147 | }  | 
                                                        
@@ -361,8 +361,7 @@  | 
                                                    ||
| 361 | 361 |              foreach ($this->output as $key => $value) { | 
                                                        
| 362 | 362 |                  $this->output[$key] = $model->{"{$this->name}_file_$key"}; | 
                                                        
| 363 | 363 | }  | 
                                                        
| 364 | - }  | 
                                                        |
| 365 | -        else { | 
                                                        |
| 364 | +        } else { | 
                                                        |
| 366 | 365 |              $meta = json_decode($model->{"{$this->name}_file_meta"}, true); | 
                                                        
| 367 | 366 | |
| 368 | 367 |              if (is_array($meta)) { | 
                                                        
@@ -495,7 +495,7 @@ discard block  | 
                                                    ||
| 495 | 495 | * @return $this  | 
                                                        
| 496 | 496 | * @throws Exception  | 
                                                        
| 497 | 497 | */  | 
                                                        
| 498 | - public function stream(string $name, int $width, int $height, int|string $audioBitrate, int|string $videoBitrate): UploadEntities  | 
                                                        |
| 498 | + public function stream(string $name, int $width, int $height, int | string $audioBitrate, int | string $videoBitrate): UploadEntities  | 
                                                        |
| 499 | 499 |      { | 
                                                        
| 500 | 500 | Validator::streamIsValid($name, $width, $height, $audioBitrate, $videoBitrate);  | 
                                                        
| 501 | 501 | |
@@ -599,12 +599,12 @@ discard block  | 
                                                    ||
| 599 | 599 | $unit = substr($number, -1);  | 
                                                        
| 600 | 600 | |
| 601 | 601 |          if (!array_key_exists($unit, $units)) { | 
                                                        
| 602 | - return (int)$number;  | 
                                                        |
| 602 | + return (int) $number;  | 
                                                        |
| 603 | 603 | }  | 
                                                        
| 604 | 604 | |
| 605 | - $number = (float)$number * $units[$unit];  | 
                                                        |
| 605 | + $number = (float) $number * $units[$unit];  | 
                                                        |
| 606 | 606 | |
| 607 | - return (int)$number;  | 
                                                        |
| 607 | + return (int) $number;  | 
                                                        |
| 608 | 608 | }  | 
                                                        
| 609 | 609 | |
| 610 | 610 | /**  | 
                                                        
@@ -685,7 +685,7 @@ discard block  | 
                                                    ||
| 685 | 685 | * @param string $path  | 
                                                        
| 686 | 686 | * @return StreamedResponse|RedirectResponse|null  | 
                                                        
| 687 | 687 | */  | 
                                                        
| 688 | - protected function storageDownload(string $path): StreamedResponse|RedirectResponse|null  | 
                                                        |
| 688 | + protected function storageDownload(string $path): StreamedResponse | RedirectResponse | null  | 
                                                        |
| 689 | 689 |      { | 
                                                        
| 690 | 690 |          if (isset($this->file) and $this->file == LARUPLOAD_NULL) { | 
                                                        
| 691 | 691 | return null;  | 
                                                        
@@ -730,7 +730,7 @@ discard block  | 
                                                    ||
| 730 | 730 | */  | 
                                                        
| 731 | 731 | protected function outputToObject(): object  | 
                                                        
| 732 | 732 |      { | 
                                                        
| 733 | - $output = (object)$this->output;  | 
                                                        |
| 733 | + $output = (object) $this->output;  | 
                                                        |
| 734 | 734 | |
| 735 | 735 |          if ($this->camelCaseResponse) { | 
                                                        
| 736 | 736 | $output->mimeType = $output->mime_type;  | 
                                                        
@@ -50,8 +50,7 @@ discard block  | 
                                                    ||
| 50 | 50 |          try { | 
                                                        
| 51 | 51 |              if ($this->standalone) { | 
                                                        
| 52 | 52 | $this->standalone->handleFFMpegQueue();  | 
                                                        
| 53 | - }  | 
                                                        |
| 54 | -            else { | 
                                                        |
| 53 | +            } else { | 
                                                        |
| 55 | 54 | /** @var \Illuminate\Database\Eloquent\Model $class */  | 
                                                        
| 56 | 55 | $class = $this->model;  | 
                                                        
| 57 | 56 | $modelNotSaved = true;  | 
                                                        
@@ -76,8 +75,7 @@ discard block  | 
                                                    ||
| 76 | 75 | }  | 
                                                        
| 77 | 76 | |
| 78 | 77 | $this->updateStatus(true, false);  | 
                                                        
| 79 | - }  | 
                                                        |
| 80 | -        catch (FileNotFoundException | Exception $e) { | 
                                                        |
| 78 | +        } catch (FileNotFoundException | Exception $e) { | 
                                                        |
| 81 | 79 | $this->updateStatus(false, false, $e->getMessage());  | 
                                                        
| 82 | 80 | |
| 83 | 81 | throw new Exception($e->getMessage());  | 
                                                        
@@ -166,7 +166,7 @@ discard block  | 
                                                    ||
| 166 | 166 | * @param string $style  | 
                                                        
| 167 | 167 | * @return RedirectResponse|StreamedResponse|null  | 
                                                        
| 168 | 168 | */  | 
                                                        
| 169 | - public function download(string $style = 'original'): StreamedResponse|RedirectResponse|null  | 
                                                        |
| 169 | + public function download(string $style = 'original'): StreamedResponse | RedirectResponse | null  | 
                                                        |
| 170 | 170 |      { | 
                                                        
| 171 | 171 | $path = $this->prepareStylePath($style);  | 
                                                        
| 172 | 172 | |
@@ -183,7 +183,7 @@ discard block  | 
                                                    ||
| 183 | 183 | * @param string|null $key  | 
                                                        
| 184 | 184 | * @return object|string|integer|null  | 
                                                        
| 185 | 185 | */  | 
                                                        
| 186 | - public function meta(string $key = null): object|int|string|null  | 
                                                        |
| 186 | + public function meta(string $key = null): object | int | string | null  | 
                                                        |
| 187 | 187 |      { | 
                                                        
| 188 | 188 |          if ($key) { | 
                                                        
| 189 | 189 | $meta = $this->output;  | 
                                                        
@@ -66,8 +66,7 @@ discard block  | 
                                                    ||
| 66 | 66 | $this->type = $this->output['type'];  | 
                                                        
| 67 | 67 | |
| 68 | 68 | return true;  | 
                                                        
| 69 | - }  | 
                                                        |
| 70 | -        else { | 
                                                        |
| 69 | +        } else { | 
                                                        |
| 71 | 70 | return false;  | 
                                                        
| 72 | 71 | }  | 
                                                        
| 73 | 72 | }  | 
                                                        
@@ -85,8 +84,7 @@ discard block  | 
                                                    ||
| 85 | 84 | $this->type = $this->output['type'];  | 
                                                        
| 86 | 85 | |
| 87 | 86 | return true;  | 
                                                        
| 88 | - }  | 
                                                        |
| 89 | -        else { | 
                                                        |
| 87 | +        } else { | 
                                                        |
| 90 | 88 | return false;  | 
                                                        
| 91 | 89 | }  | 
                                                        
| 92 | 90 | }  | 
                                                        
@@ -106,8 +104,7 @@ discard block  | 
                                                    ||
| 106 | 104 |          if (isset($this->file)) { | 
                                                        
| 107 | 105 |              if ($this->file == LARUPLOAD_NULL) { | 
                                                        
| 108 | 106 | $this->clean($model->id);  | 
                                                        
| 109 | - }  | 
                                                        |
| 110 | -            else { | 
                                                        |
| 107 | +            } else { | 
                                                        |
| 111 | 108 |                  if (!$this->keepOldFiles) { | 
                                                        
| 112 | 109 | $this->clean($model->id);  | 
                                                        
| 113 | 110 | }  | 
                                                        
@@ -120,8 +117,7 @@ discard block  | 
                                                    ||
| 120 | 117 | }  | 
                                                        
| 121 | 118 | |
| 122 | 119 | $model = $this->setAttributes($model);  | 
                                                        
| 123 | - }  | 
                                                        |
| 124 | -        else if (isset($this->cover)) { | 
                                                        |
| 120 | +        } else if (isset($this->cover)) { | 
                                                        |
| 125 | 121 | $this->setCover($model->id);  | 
                                                        
| 126 | 122 | |
| 127 | 123 | $model = $this->setAttributes($model);  | 
                                                        
@@ -213,8 +209,7 @@ discard block  | 
                                                    ||
| 213 | 209 |              if ($style == LaruploadEnum::COVER_FOLDER and !$this->generateCover) { | 
                                                        
| 214 | 210 |                  $styles->{$style} = null; | 
                                                        
| 215 | 211 | continue;  | 
                                                        
| 216 | - }  | 
                                                        |
| 217 | -            else if ($style == LaruploadEnum::STREAM_FOLDER and empty($this->streams)) { | 
                                                        |
| 212 | +            } else if ($style == LaruploadEnum::STREAM_FOLDER and empty($this->streams)) { | 
                                                        |
| 218 | 213 |                  unset($styles->{$style}); | 
                                                        
| 219 | 214 | continue;  | 
                                                        
| 220 | 215 | }  | 
                                                        
@@ -408,8 +403,7 @@ discard block  | 
                                                    ||
| 408 | 403 | case LaruploadEnum::VIDEO:  | 
                                                        
| 409 | 404 |                  if ($this->ffmpegQueue) { | 
                                                        
| 410 | 405 | $this->initializeFFMpegQueue($id, $class, $standalone);  | 
                                                        
| 411 | - }  | 
                                                        |
| 412 | -                else { | 
                                                        |
| 406 | +                } else { | 
                                                        |
| 413 | 407 | $this->handleVideoStyles($id);  | 
                                                        
| 414 | 408 | }  | 
                                                        
| 415 | 409 | |
@@ -461,8 +455,7 @@ discard block  | 
                                                    ||
| 461 | 455 | |
| 462 | 456 |          if ($maxQueueNum == 0) { | 
                                                        
| 463 | 457 | $flag = true;  | 
                                                        
| 464 | - }  | 
                                                        |
| 465 | -        else { | 
                                                        |
| 458 | +        } else { | 
                                                        |
| 466 | 459 |              $availableQueues = DB::table(LaruploadEnum::FFMPEG_QUEUE_TABLE)->where('status', 0)->count(); | 
                                                        
| 467 | 460 | |
| 468 | 461 |              if ($availableQueues < $maxQueueNum) { | 
                                                        
@@ -496,8 +489,7 @@ discard block  | 
                                                    ||
| 496 | 489 | |
| 497 | 490 | |
| 498 | 491 | ProcessFFMpeg::dispatch($queueId, $id, $this->name, $class, $serializedClass);  | 
                                                        
| 499 | - }  | 
                                                        |
| 500 | -        else { | 
                                                        |
| 492 | +        } else { | 
                                                        |
| 501 | 493 | throw new HttpResponseException(redirect(URL::previous())->withErrors([  | 
                                                        
| 502 | 494 |                  'ffmpeg_queue_max_num' => trans('larupload::messages.max-queue-num-exceeded') | 
                                                        
| 503 | 495 | ]));  | 
                                                        
@@ -531,8 +523,7 @@ discard block  | 
                                                    ||
| 531 | 523 |              foreach ($this->output as $key => $value) { | 
                                                        
| 532 | 524 |                  $model->{"{$this->name}_file_$key"} = $value; | 
                                                        
| 533 | 525 | }  | 
                                                        
| 534 | - }  | 
                                                        |
| 535 | -        else { | 
                                                        |
| 526 | +        } else { | 
                                                        |
| 536 | 527 |              $model->{"{$this->name}_file_name"} = $this->output['name'] ?? null; | 
                                                        
| 537 | 528 |              $model->{"{$this->name}_file_meta"} = json_encode($this->output); | 
                                                        
| 538 | 529 | }  | 
                                                        
@@ -564,8 +555,7 @@ discard block  | 
                                                    ||
| 564 | 555 | }  | 
                                                        
| 565 | 556 | |
| 566 | 557 | return null;  | 
                                                        
| 567 | - }  | 
                                                        |
| 568 | -            else if ($name and $this->styleHasFile($style)) { | 
                                                        |
| 558 | +            } else if ($name and $this->styleHasFile($style)) { | 
                                                        |
| 569 | 559 | $name = $this->fixExceptionNames($name, $style);  | 
                                                        
| 570 | 560 | $path = $this->getBasePath($this->id, $style);  | 
                                                        
| 571 | 561 | |
@@ -34,17 +34,13 @@ discard block  | 
                                                    ||
| 34 | 34 |      { | 
                                                        
| 35 | 35 |          if (str_contains($mime, 'image/')) { | 
                                                        
| 36 | 36 | return LaruploadEnum::IMAGE;  | 
                                                        
| 37 | - }  | 
                                                        |
| 38 | -        else if (str_contains($mime, 'video/')) { | 
                                                        |
| 37 | +        } else if (str_contains($mime, 'video/')) { | 
                                                        |
| 39 | 38 | return LaruploadEnum::VIDEO;  | 
                                                        
| 40 | - }  | 
                                                        |
| 41 | -        else if (str_contains($mime, 'audio/')) { | 
                                                        |
| 39 | +        } else if (str_contains($mime, 'audio/')) { | 
                                                        |
| 42 | 40 | return LaruploadEnum::AUDIO;  | 
                                                        
| 43 | - }  | 
                                                        |
| 44 | -        else if ($mime == 'application/pdf') { | 
                                                        |
| 41 | +        } else if ($mime == 'application/pdf') { | 
                                                        |
| 45 | 42 | return LaruploadEnum::PDF;  | 
                                                        
| 46 | - }  | 
                                                        |
| 47 | -        else if ($mime == 'application/zip' or $mime == 'application/x-rar-compressed') { | 
                                                        |
| 43 | +        } else if ($mime == 'application/zip' or $mime == 'application/x-rar-compressed') { | 
                                                        |
| 48 | 44 | return LaruploadEnum::COMPRESSED;  | 
                                                        
| 49 | 45 | }  | 
                                                        
| 50 | 46 | |
@@ -92,11 +88,9 @@ discard block  | 
                                                    ||
| 92 | 88 |      { | 
                                                        
| 93 | 89 |          if (ini_get('upload_tmp_dir')) { | 
                                                        
| 94 | 90 |              $path = ini_get('upload_tmp_dir'); | 
                                                        
| 95 | - }  | 
                                                        |
| 96 | -        else if (getenv('temp')) { | 
                                                        |
| 91 | +        } else if (getenv('temp')) { | 
                                                        |
| 97 | 92 |              $path = getenv('temp'); | 
                                                        
| 98 | - }  | 
                                                        |
| 99 | -        else { | 
                                                        |
| 93 | +        } else { | 
                                                        |
| 100 | 94 | $path = sys_get_temp_dir();  | 
                                                        
| 101 | 95 | }  | 
                                                        
| 102 | 96 | |
@@ -30,8 +30,7 @@  | 
                                                    ||
| 30 | 30 |              $table->string("{$name}_file_dominant_color", 7)->nullable(); | 
                                                        
| 31 | 31 |              $table->string("{$name}_file_format", 85)->nullable(); | 
                                                        
| 32 | 32 |              $table->string("{$name}_file_cover", 85)->nullable(); | 
                                                        
| 33 | - }  | 
                                                        |
| 34 | -        else { | 
                                                        |
| 33 | +        } else { | 
                                                        |
| 35 | 34 |              $table->{self::jsonColumnType()}("{$name}_file_meta")->nullable(); | 
                                                        
| 36 | 35 | }  | 
                                                        
| 37 | 36 | }  |