@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | |
| 11 | 11 | class AudioStyle extends Style |
| 12 | 12 | { |
| 13 | - public readonly Mp3|Aac|Wav|Flac $format; |
|
| 13 | + public readonly Mp3 | Aac | Wav | Flac $format; |
|
| 14 | 14 | |
| 15 | 15 | |
| 16 | - public function __construct(string $name, Mp3|Aac|Wav|Flac $format = new Mp3) |
|
| 16 | + public function __construct(string $name, Mp3 | Aac | Wav | Flac $format = new Mp3) |
|
| 17 | 17 | { |
| 18 | 18 | parent::__construct($name); |
| 19 | 19 | |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | - public static function make(string $name, Mp3|Aac|Wav|Flac $format = new Mp3): self |
|
| 24 | + public static function make(string $name, Mp3 | Aac | Wav | Flac $format = new Mp3): self |
|
| 25 | 25 | { |
| 26 | 26 | return new self($name, $format); |
| 27 | 27 | } |
@@ -30,11 +30,9 @@ |
||
| 30 | 30 | { |
| 31 | 31 | if ($this->format instanceof Aac) { |
| 32 | 32 | return 'aac'; |
| 33 | - } |
|
| 34 | - else if ($this->format instanceof Wav) { |
|
| 33 | + } else if ($this->format instanceof Wav) { |
|
| 35 | 34 | return 'wav'; |
| 36 | - } |
|
| 37 | - else if ($this->format instanceof Flac) { |
|
| 35 | + } else if ($this->format instanceof Flac) { |
|
| 38 | 36 | return 'flac'; |
| 39 | 37 | } |
| 40 | 38 | |
@@ -85,7 +85,7 @@ |
||
| 85 | 85 | return $this; |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | - public function audio(string $name, Mp3|Aac|Wav|Flac $format = new Mp3): UploadEntities |
|
| 88 | + public function audio(string $name, Mp3 | Aac | Wav | Flac $format = new Mp3): UploadEntities |
|
| 89 | 89 | { |
| 90 | 90 | $this->audioStyles[$name] = AudioStyle::make($name, $format); |
| 91 | 91 | |
@@ -25,8 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | if ($this->type == LaruploadFileType::VIDEO) { |
| 27 | 27 | $this->handleVideoStyles($this->id); |
| 28 | - } |
|
| 29 | - else if ($this->type == LaruploadFileType::AUDIO) { |
|
| 28 | + } else if ($this->type == LaruploadFileType::AUDIO) { |
|
| 30 | 29 | $this->handleAudioStyles($this->id); |
| 31 | 30 | } |
| 32 | 31 | |
@@ -44,8 +43,7 @@ discard block |
||
| 44 | 43 | |
| 45 | 44 | if ($maxQueueNum == 0) { |
| 46 | 45 | $flag = true; |
| 47 | - } |
|
| 48 | - else { |
|
| 46 | + } else { |
|
| 49 | 47 | $availableQueues = DB::table(Larupload::FFMPEG_QUEUE_TABLE) |
| 50 | 48 | ->where('status', 0) |
| 51 | 49 | ->count(); |
@@ -82,8 +80,7 @@ discard block |
||
| 82 | 80 | |
| 83 | 81 | |
| 84 | 82 | ProcessFFMpeg::dispatch($queueId, $id, $this->name, $class, $serializedClass); |
| 85 | - } |
|
| 86 | - else { |
|
| 83 | + } else { |
|
| 87 | 84 | throw new HttpResponseException(redirect(URL::previous())->withErrors([ |
| 88 | 85 | 'ffmpeg_queue_max_num' => trans('larupload::messages.max-queue-num-exceeded') |
| 89 | 86 | ])); |
@@ -42,14 +42,12 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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); |