From ed116d06cace50412ca57dc2474e8275f2ac7ee6 Mon Sep 17 00:00:00 2001 From: awcodes Date: Mon, 5 Aug 2024 13:09:46 +0000 Subject: [PATCH] Format Code --- config/curator.php | 2 +- resources/lang/vi/views.php | 2 +- src/Actions/MediaAction.php | 1 - src/Components/Forms/CuratorPicker.php | 7 ++++++- src/Components/Modals/CuratorPanel.php | 6 +++--- src/Concerns/HasGlideSettings.php | 2 +- src/CuratorPlugin.php | 6 ++---- src/Glide/GlideBuilder.php | 3 +-- 8 files changed, 15 insertions(+), 14 deletions(-) diff --git a/config/curator.php b/config/curator.php index 4be6f060..8ddf0018 100644 --- a/config/curator.php +++ b/config/curator.php @@ -63,5 +63,5 @@ 'multi_select_key' => 'metaKey', 'table' => [ 'layout' => 'grid', - ] + ], ]; diff --git a/resources/lang/vi/views.php b/resources/lang/vi/views.php index 9ec0c9bf..451311da 100644 --- a/resources/lang/vi/views.php +++ b/resources/lang/vi/views.php @@ -44,7 +44,7 @@ 'download' => 'Tải xuống', 'remove' => 'Chọn tên tin khác', 'deselect_all' => 'Ẩn tất cả lựa chọn', - 'add_multiple_file' => 'Cmd + Click để chọn nhiều tệp tin' + 'add_multiple_file' => 'Cmd + Click để chọn nhiều tệp tin', ], 'curation' => [ 'thumbnail' => 'Hình ảnh thu nhỏ', diff --git a/src/Actions/MediaAction.php b/src/Actions/MediaAction.php index 11e5a0c3..e5c874d5 100644 --- a/src/Actions/MediaAction.php +++ b/src/Actions/MediaAction.php @@ -2,7 +2,6 @@ namespace Awcodes\Curator\Actions; -use Awcodes\Curator\Components\Forms\CuratorPicker; use Awcodes\Curator\Models\Media; use Filament\Forms\Components\Actions\Action; use FilamentTiptapEditor\TiptapEditor; diff --git a/src/Components/Forms/CuratorPicker.php b/src/Components/Forms/CuratorPicker.php index 04ff3afb..5d6b56f6 100644 --- a/src/Components/Forms/CuratorPicker.php +++ b/src/Components/Forms/CuratorPicker.php @@ -16,8 +16,8 @@ use Illuminate\Contracts\Support\Htmlable; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\BelongsTo; -use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Database\Eloquent\Relations\BelongsToMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Support\Arr; use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\Storage; @@ -470,11 +470,13 @@ public function relationship(string | Closure $relationshipName, string | Closur })->toArray(); $component->state($relatedMedia); + return; } $relatedModels = $relationship->getResults(); $component->state($relatedModels); + return; } @@ -509,11 +511,13 @@ public function relationship(string | Closure $relationshipName, string | Closur }); $relationship->sync($state ?? []); + return; } $state = Arr::pluck($state, 'id'); $relationship->sync($state ?? []); + return; } @@ -545,6 +549,7 @@ public function relationship(string | Closure $relationshipName, string | Closur } $i++; } + return; } } diff --git a/src/Components/Modals/CuratorPanel.php b/src/Components/Modals/CuratorPanel.php index dd50849d..c0d17896 100644 --- a/src/Components/Modals/CuratorPanel.php +++ b/src/Components/Modals/CuratorPanel.php @@ -204,7 +204,7 @@ public function getFiles(int $page = 0, bool $excludeSelected = false): array return $query->where('directory', $this->directory); }) ->when($this->types, function ($query) { - return $query->where(function($query){ + return $query->where(function ($query) { $types = $this->types; $query = $query->whereIn('type', $types); $wildcardTypes = collect($types)->filter(fn ($type) => str_contains($type, '*')); @@ -404,7 +404,7 @@ public function destroyAction(): Action ->body(trans('curator::notifications.delete_success')) ->send(); } else { - throw new Exception(); + throw new Exception; } } catch (Exception) { Notification::make('curator_delete_error') @@ -479,7 +479,7 @@ public function updateFileAction(): Action ->body(trans('curator::notifications.update_success')) ->send(); } else { - throw new Exception(); + throw new Exception; } } catch (Exception) { Notification::make('curator_update_error') diff --git a/src/Concerns/HasGlideSettings.php b/src/Concerns/HasGlideSettings.php index 0b199502..a2ef74cb 100644 --- a/src/Concerns/HasGlideSettings.php +++ b/src/Concerns/HasGlideSettings.php @@ -27,7 +27,7 @@ public function getGliderFallbacks(): ?array public function getGlideServer(): Server | ServerFactory { if (! $this->glideServer) { - return (new DefaultServerFactory())->getFactory(); + return (new DefaultServerFactory)->getFactory(); } return $this->glideServer; diff --git a/src/CuratorPlugin.php b/src/CuratorPlugin.php index e5f05e02..172575fe 100644 --- a/src/CuratorPlugin.php +++ b/src/CuratorPlugin.php @@ -44,7 +44,7 @@ public function register(Panel $panel): void $this->getResource(), ]); - if (!is_panel_auth_route()) { + if (! is_panel_auth_route()) { $panel ->renderHook( 'panels::body.end', @@ -53,9 +53,7 @@ public function register(Panel $panel): void } } - public function boot(Panel $panel): void - { - } + public function boot(Panel $panel): void {} public static function make(): static { diff --git a/src/Glide/GlideBuilder.php b/src/Glide/GlideBuilder.php index b7f3967c..f3b4b2ca 100644 --- a/src/Glide/GlideBuilder.php +++ b/src/Glide/GlideBuilder.php @@ -35,8 +35,7 @@ final public function __construct( public ?string $markpos = null, public ?int $markalpha = null, public ?string $markfit = null, - ) { - } + ) {} public static function make(): static {