@@ -74,9 +74,9 @@ |
||
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 |
@@ -49,7 +49,7 @@ |
||
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; |
@@ -75,7 +75,7 @@ |
||
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; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | /** |
42 | 42 | * @internal |
43 | 43 | */ |
44 | - public function download(string $style = 'original'): StreamedResponse|RedirectResponse|null |
|
44 | + public function download(string $style = 'original'): StreamedResponse | RedirectResponse | null |
|
45 | 45 | { |
46 | 46 | $this->internalException(); |
47 | 47 | } |
@@ -31,7 +31,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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); |
@@ -36,7 +36,7 @@ |
||
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; |
@@ -18,7 +18,7 @@ |
||
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: |
@@ -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 | } |
@@ -80,14 +80,14 @@ |
||
80 | 80 | return $this; |
81 | 81 | } |
82 | 82 | |
83 | - public function video(string $name, ?int $width = null, ?int $height = null, LaruploadMediaStyle $mode = LaruploadMediaStyle::SCALE_HEIGHT, X264|WebM|Ogg|Mp3|Aac|Wav|Flac $format = new X264, bool $padding = false): UploadEntities |
|
83 | + public function video(string $name, ?int $width = null, ?int $height = null, LaruploadMediaStyle $mode = LaruploadMediaStyle::SCALE_HEIGHT, X264 | WebM | Ogg | Mp3 | Aac | Wav | Flac $format = new X264, bool $padding = false): UploadEntities |
|
84 | 84 | { |
85 | 85 | $this->videoStyles[$name] = VideoStyle::make($name, $width, $height, $mode, $format, $padding); |
86 | 86 | |
87 | 87 | return $this; |
88 | 88 | } |
89 | 89 | |
90 | - public function audio(string $name, Mp3|Aac|Wav|Flac $format = new Mp3): UploadEntities |
|
90 | + public function audio(string $name, Mp3 | Aac | Wav | Flac $format = new Mp3): UploadEntities |
|
91 | 91 | { |
92 | 92 | $this->audioStyles[$name] = AudioStyle::make($name, $format); |
93 | 93 |