Apply fixes from StyleCI

This commit is contained in:
StyleCI Bot
2024-03-18 17:48:57 +00:00
parent 1bea8f8d5c
commit 8fa00e2ef6
57 changed files with 148 additions and 131 deletions

View File

@@ -2,9 +2,9 @@
namespace Database\Seeders;
use Illuminate\Database\Seeder;
use App\Models\ChampionRoles;
use App\Models\Champion;
use App\Models\ChampionRoles;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
@@ -23,8 +23,8 @@ class ChampionRolesSeeder extends Seeder
$rolesExists = ChampionRoles::where('champion_id', $championId)->first();
$championExists = Champion::where('champion_id', $championId)->first();
if (!$championExists) {
Log::info('Champion with ID ' . $championId . ' does not exist, skipping...');
if (! $championExists) {
Log::info('Champion with ID '.$championId.' does not exist, skipping...');
continue;
}
@@ -45,11 +45,11 @@ class ChampionRolesSeeder extends Seeder
];
if ($rolesExists && $this->hasAttributesChanged($rolesExists, $rolesAttributes)) {
Log::info('Roles for ' . $championName . ' have changed, updating...');
Log::info('Roles for '.$championName.' have changed, updating...');
$rolesExists->update($rolesAttributes);
$changeCount++;
} elseif (!$rolesExists) {
Log::info('New roles detected for ' . $championName . '! Creating...');
} elseif (! $rolesExists) {
Log::info('New roles detected for '.$championName.'! Creating...');
ChampionRoles::create($rolesAttributes);
$changeCount++;
}

View File

@@ -41,11 +41,11 @@ class ChampionSeeder extends Seeder
// Check if the champion already exists and if any attributes have changed, if so update the champion. If the champion doesn't exist, create it.
// This is to prevent the champion data from being updated every time the seeder is run. As I'll probably run this on a cron job.
if ($championExists && $this->hasAttributesChanged($championExists, $championAttributes)) {
Log::info('Champion ' . $champion['name'] . ' has changed, updating...');
Log::info('Champion '.$champion['name'].' has changed, updating...');
$championExists->update($championAttributes);
$changeCount++;
} elseif (!$championExists) {
Log::info('New champion detected! Creating ' . $champion['name'] . '...');
} elseif (! $championExists) {
Log::info('New champion detected! Creating '.$champion['name'].'...');
Champion::create($championAttributes);
$changeCount++;
}

View File

@@ -36,7 +36,7 @@ class ChampionSkinSeeder extends Seeder
'champion_id' => $champion['id'],
'full_skin_id' => $skin['id'],
'skin_id' => substr($skin['id'], 3),
'skin_name' => $skin['name'] . ' ' . $champion['name'],
'skin_name' => $skin['name'].' '.$champion['name'],
'lore' => $skin['lore'],
'availability' => $skin['availability'],
'loot_eligible' => $skin['lootEligible'],
@@ -65,11 +65,11 @@ class ChampionSkinSeeder extends Seeder
// Check if the skin already exists and if any attributes have changed, if so update the skin. If the skin doesn't exist, create it.
// This is to prevent the skin data from being updated every time the seeder is run. As I'll probably run this on a cron job.
if ($skinExists && $this->hasAttributesChanged($skinExists, $skinAttributes)) {
Log::info('Skin ' . $skin['name'] . ' ' . $champion['name'] . ' has changed, updating...');
Log::info('Skin '.$skin['name'].' '.$champion['name'].' has changed, updating...');
$skinExists->update($skinAttributes);
$changeCount++;
} elseif (!$skinExists) {
Log::info('New skin detected! Creating ' . $skin['name'] . ' ' . $champion['name'] . '...');
} elseif (! $skinExists) {
Log::info('New skin detected! Creating '.$skin['name'].' '.$champion['name'].'...');
ChampionSkin::create($skinAttributes);
$changeCount++;
}

View File

@@ -4,8 +4,8 @@ namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
class DatabaseSeeder extends Seeder
{
@@ -23,6 +23,6 @@ class DatabaseSeeder extends Seeder
Cache::flush();
Log::info('Seeding complete at ' . date('Y-m-d H:i:s'));
Log::info('Seeding complete at '.date('Y-m-d H:i:s'));
}
}

View File

@@ -34,7 +34,7 @@ class SkinChromaSeeder extends Seeder
$chromaAttributes = [
'chroma_id' => $chromaId,
'full_skin_id' => $skin['id'],
'skin_name' => $skin['name'] . ' ' . $champion['name'],
'skin_name' => $skin['name'].' '.$champion['name'],
'chroma_name' => $chroma['name'],
'chroma_colors' => $chroma['colors'],
'chroma_image' => $chroma['chromaPath'],
@@ -50,11 +50,11 @@ class SkinChromaSeeder extends Seeder
}
if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) {
Log::info('Updating chroma: ' . $chromaId);
Log::info('Updating chroma: '.$chromaId);
$chromaExists->update($chromaAttributes);
$changeCount++;
} elseif (!$chromaExists) {
Log::info('Creating chroma: ' . $chromaId);
} elseif (! $chromaExists) {
Log::info('Creating chroma: '.$chromaId);
SkinChroma::create($chromaAttributes);
$changeCount++;
}

View File

@@ -20,9 +20,9 @@ class SummonerEmoteSeeder extends Seeder
foreach ($emoteData as $emote) {
if (str_contains($emote['name'], 'game_summoner_emote_name_')
|| $emote['inventoryIcon'] === ""
|| $emote['inventoryIcon'] === ''
|| empty($emote['inventoryIcon'])
|| $emote['inventoryIcon'] === "/lol-game-data/assets/"
|| $emote['inventoryIcon'] === '/lol-game-data/assets/'
|| $emote['id'] === 0) {
continue;
}
@@ -30,7 +30,7 @@ class SummonerEmoteSeeder extends Seeder
$emoteId = $emote['id'];
$emoteExists = SummonerEmote::where('emote_id', $emoteId)->first();
$afterKeyword = str_replace('/lol-game-data/assets/ASSETS/Loadouts/SummonerEmotes', '', $emote['inventoryIcon']);
$imageUrl = 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/assets/loadouts/summoneremotes' . strtolower($afterKeyword);
$imageUrl = 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/assets/loadouts/summoneremotes'.strtolower($afterKeyword);
$emoteAttributes = [
'emote_id' => $emote['id'],
@@ -39,11 +39,11 @@ class SummonerEmoteSeeder extends Seeder
];
if ($emoteExists && $this->hasAttributesChanged($emoteExists, $emoteAttributes)) {
Log::info('Emote ' . $emoteId . ' has changed, updating...');
Log::info('Emote '.$emoteId.' has changed, updating...');
$emoteExists->update($emoteAttributes);
$changeCount++;
} elseif (!$emoteExists) {
Log::info('New emote detected! Creating ' . $emoteId . '...');
} elseif (! $emoteExists) {
Log::info('New emote detected! Creating '.$emoteId.'...');
SummonerEmote::create($emoteAttributes);
$changeCount++;
}

View File

@@ -32,7 +32,7 @@ class SummonerIconSeeder extends Seeder
'description' => $icon['descriptions'][0]['description'] ?? null,
'release_year' => $icon['yearReleased'],
'legacy' => $icon['isLegacy'],
'image' => 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/' . $icon['id'] . '.jpg',
'image' => 'https://raw.communitydragon.org/latest/plugins/rcp-be-lol-game-data/global/default/v1/profile-icons/'.$icon['id'].'.jpg',
'esports_team' => $icon['esportsTeam'] ?? null,
'esports_region' => $icon['esportsRegion'] ?? null,
'esports_event' => $icon['esportsEvent'] ?? null,
@@ -41,11 +41,11 @@ class SummonerIconSeeder extends Seeder
// Check if the champion already exists and if any attributes have changed, if so update the champion. If the champion doesn't exist, create it.
// This is to prevent the champion data from being updated every time the seeder is run. As I'll probably run this on a cron job.
if ($iconExists && $this->hasAttributesChanged($iconExists, $iconAttributes)) {
Log::info('Icon ' . $iconId . ' has changed, updating...');
Log::info('Icon '.$iconId.' has changed, updating...');
$iconExists->update($iconAttributes);
$changeCount++;
} elseif (!$iconExists) {
Log::info('New icon detected! Creating ' . $iconId . '...');
} elseif (! $iconExists) {
Log::info('New icon detected! Creating '.$iconId.'...');
SummonerIcon::create($iconAttributes);
$changeCount++;
}