From cd709d7255c5fca58133435d66533fa407107a51 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Wed, 1 May 2024 22:51:00 +0000 Subject: [PATCH] Apply fixes from StyleCI --- app/Helpers/HelperFunctions.php | 10 +++++----- app/Models/Champion.php | 4 ++-- database/seeders/ChampionImageSeeder.php | 15 +++++++-------- database/seeders/DatabaseSeeder.php | 2 +- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/app/Helpers/HelperFunctions.php b/app/Helpers/HelperFunctions.php index 249d894..9995479 100644 --- a/app/Helpers/HelperFunctions.php +++ b/app/Helpers/HelperFunctions.php @@ -1,8 +1,8 @@ where('type', $type)->first(); - if (!$championImage) { + if (! $championImage) { return ''; } diff --git a/app/Models/Champion.php b/app/Models/Champion.php index 658a484..8695168 100644 --- a/app/Models/Champion.php +++ b/app/Models/Champion.php @@ -101,12 +101,12 @@ class Champion extends Model public function getChampionImageAttribute(bool $uncentered = false): string { - return getChampionImage($this->champion_id . '000', $uncentered ? 'uncentered_splash' : 'splash'); + return getChampionImage($this->champion_id.'000', $uncentered ? 'uncentered_splash' : 'splash'); } public function getChampionImageTileAttribute(): string { - return getChampionImage($this->champion_id . '000', 'tile'); + return getChampionImage($this->champion_id.'000', 'tile'); } public function getChampionSquareImageAttribute(): string diff --git a/database/seeders/ChampionImageSeeder.php b/database/seeders/ChampionImageSeeder.php index 007185c..50227a3 100644 --- a/database/seeders/ChampionImageSeeder.php +++ b/database/seeders/ChampionImageSeeder.php @@ -2,10 +2,9 @@ namespace Database\Seeders; -use Illuminate\Database\Console\Seeds\WithoutModelEvents; -use Illuminate\Database\Seeder; -use App\Models\ChampionImage; use App\Models\Champion; +use App\Models\ChampionImage; +use Illuminate\Database\Seeder; class ChampionImageSeeder extends Seeder { @@ -16,7 +15,7 @@ class ChampionImageSeeder extends Seeder { // Loop over all champions Champion::all()->each(function ($champion) { - $dataJson = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champions/' . $champion->champion_id . '.json'; + $dataJson = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champions/'.$champion->champion_id.'.json'; $data = json_decode(file_get_contents($dataJson), true); @@ -27,28 +26,28 @@ class ChampionImageSeeder extends Seeder $splash->full_id = $skin['id']; $splash->champion_id = $champion->champion_id; $splash->type = 'splash'; - $splash->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/' . strtolower(substr($skin['splashPath'], strpos($skin['splashPath'], 'ASSETS'))); + $splash->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/'.strtolower(substr($skin['splashPath'], strpos($skin['splashPath'], 'ASSETS'))); $splash->save(); $uncenteredSplash = new ChampionImage(); $uncenteredSplash->full_id = $skin['id']; $uncenteredSplash->champion_id = $champion->champion_id; $uncenteredSplash->type = 'uncentered_splash'; - $uncenteredSplash->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/' . strtolower(substr($skin['uncenteredSplashPath'], strpos($skin['uncenteredSplashPath'], 'ASSETS'))); + $uncenteredSplash->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/'.strtolower(substr($skin['uncenteredSplashPath'], strpos($skin['uncenteredSplashPath'], 'ASSETS'))); $uncenteredSplash->save(); $loading = new ChampionImage(); $loading->full_id = $skin['id']; $loading->champion_id = $champion->champion_id; $loading->type = 'loading'; - $loading->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/' . strtolower(substr($skin['loadScreenPath'], strpos($skin['loadScreenPath'], 'ASSETS'))); + $loading->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/'.strtolower(substr($skin['loadScreenPath'], strpos($skin['loadScreenPath'], 'ASSETS'))); $loading->save(); $tile = new ChampionImage(); $tile->full_id = $skin['id']; $tile->champion_id = $champion->champion_id; $tile->type = 'tile'; - $tile->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/' . strtolower(substr($skin['tilePath'], strpos($skin['tilePath'], 'ASSETS'))); + $tile->url = 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/'.strtolower(substr($skin['tilePath'], strpos($skin['tilePath'], 'ASSETS'))); $tile->save(); } }); diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index f7db022..317b893 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -4,9 +4,9 @@ namespace Database\Seeders; // use Illuminate\Database\Console\Seeds\WithoutModelEvents; use Illuminate\Database\Seeder; +use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Log; -use Illuminate\Support\Facades\Artisan; class DatabaseSeeder extends Seeder {