From 934ccfec37d751f8e9175801aff93979a31ba05a Mon Sep 17 00:00:00 2001 From: Asnxthaony Date: Thu, 1 Dec 2022 12:07:14 +0800 Subject: [PATCH] fix ci --- plugins/insane-profile-cache/src/Commands/Clean.php | 5 ++--- plugins/insane-profile-cache/src/Commands/Generate.php | 9 ++++----- .../src/Listener/DeleteFileCache.php | 8 +++----- .../src/Listener/UpdateFileCache.php | 10 ++++------ 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/plugins/insane-profile-cache/src/Commands/Clean.php b/plugins/insane-profile-cache/src/Commands/Clean.php index 574579db..88b276d3 100644 --- a/plugins/insane-profile-cache/src/Commands/Clean.php +++ b/plugins/insane-profile-cache/src/Commands/Clean.php @@ -2,7 +2,6 @@ namespace InsaneProfileCache\Commands; -use File; use Illuminate\Console\Command; class Clean extends Command @@ -14,8 +13,8 @@ class Clean extends Command public function handle() { $dir = storage_path('insane-profile-cache'); - if (File::exists($dir)) { - File::deleteDirectory(storage_path('insane-profile-cache')); + if (\File::exists($dir)) { + \File::deleteDirectory(storage_path('insane-profile-cache')); } $this->info('Cache deleted.'); diff --git a/plugins/insane-profile-cache/src/Commands/Generate.php b/plugins/insane-profile-cache/src/Commands/Generate.php index 36ad2e24..ce8bbc8a 100644 --- a/plugins/insane-profile-cache/src/Commands/Generate.php +++ b/plugins/insane-profile-cache/src/Commands/Generate.php @@ -3,7 +3,6 @@ namespace InsaneProfileCache\Commands; use App\Models\Player; -use File; use Illuminate\Console\Command; class Generate extends Command @@ -15,8 +14,8 @@ class Generate extends Command public function handle() { $dir = storage_path('insane-profile-cache'); - if (File::missing($dir)) { - File::makeDirectory($dir); + if (\File::missing($dir)) { + \File::makeDirectory($dir); } $players = Player::all(); @@ -25,8 +24,8 @@ public function handle() $players->each(function ($player) use ($dir, $bar) { $cachePath = storage_path('insane-profile-cache/'.$player->name.'.json'); - if (File::dirname($cachePath) === $dir) { - File::put($cachePath, $player->toJson()); + if (\File::dirname($cachePath) === $dir) { + \File::put($cachePath, $player->toJson()); } $bar->advance(); diff --git a/plugins/insane-profile-cache/src/Listener/DeleteFileCache.php b/plugins/insane-profile-cache/src/Listener/DeleteFileCache.php index a97200cc..c475c164 100644 --- a/plugins/insane-profile-cache/src/Listener/DeleteFileCache.php +++ b/plugins/insane-profile-cache/src/Listener/DeleteFileCache.php @@ -2,21 +2,19 @@ namespace InsaneProfileCache\Listener; -use File; - class DeleteFileCache { public function handle($event) { $dir = storage_path('insane-profile-cache'); - if (File::missing($dir)) { + if (\File::missing($dir)) { return; } $cachePath = storage_path('insane-profile-cache/'.$event->playerName.'.json'); - if (File::dirname($cachePath) === $dir) { - File::delete($cachePath); + if (\File::dirname($cachePath) === $dir) { + \File::delete($cachePath); } } } diff --git a/plugins/insane-profile-cache/src/Listener/UpdateFileCache.php b/plugins/insane-profile-cache/src/Listener/UpdateFileCache.php index c2d2fc01..6a61b2b4 100644 --- a/plugins/insane-profile-cache/src/Listener/UpdateFileCache.php +++ b/plugins/insane-profile-cache/src/Listener/UpdateFileCache.php @@ -2,22 +2,20 @@ namespace InsaneProfileCache\Listener; -use File; - class UpdateFileCache { public function handle($event) { $dir = storage_path('insane-profile-cache'); - if (File::missing($dir)) { - File::makeDirectory($dir); + if (\File::missing($dir)) { + \File::makeDirectory($dir); } $player = $event->player; $cachePath = storage_path('insane-profile-cache/'.$player->name.'.json'); - if (File::dirname($cachePath) === $dir) { - File::put($cachePath, $player->toJson()); + if (\File::dirname($cachePath) === $dir) { + \File::put($cachePath, $player->toJson()); } } }