style: laravel pint lint

This commit is contained in:
Rico van Zelst
2023-11-01 14:09:25 +01:00
parent 69c072a003
commit 9ced9a83f3
10 changed files with 47 additions and 45 deletions

View File

@@ -2,9 +2,8 @@
namespace Database\Seeders;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\SkinChroma;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
class SkinChromaSeeder extends Seeder
@@ -14,16 +13,18 @@ class SkinChromaSeeder extends Seeder
*/
public function run(): void
{
$championDataUrl = "http://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json";
$championDataUrl = 'http://cdn.merakianalytics.com/riot/lol/resources/latest/en-US/champions.json';
$championData = json_decode(file_get_contents($championDataUrl), true);
foreach ($championData as $champion) {
foreach ($champion['skins'] as $skin) {
if ($skin['name'] === "Original") {
if ($skin['name'] === 'Original') {
continue;
}
foreach ($skin['chromas'] as $chroma) {
if ($chroma === null) continue; // To address: https://github.com/meraki-analytics/lolstaticdata/issues/71
if ($chroma === null) {
continue;
} // To address: https://github.com/meraki-analytics/lolstaticdata/issues/71
$chromaId = $chroma['id'];
@@ -31,7 +32,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'],
@@ -43,10 +44,10 @@ class SkinChromaSeeder extends Seeder
}
if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) {
Log::info('Updating chroma: ' . $chromaId);
Log::info('Updating chroma: '.$chromaId);
$chromaExists->update($chromaAttributes);
} else if (!$chromaExists) {
Log::info('Creating chroma: ' . $chromaId);
} elseif (! $chromaExists) {
Log::info('Creating chroma: '.$chromaId);
SkinChroma::create($chromaAttributes);
}
}
@@ -61,6 +62,7 @@ class SkinChromaSeeder extends Seeder
return true;
}
}
return false;
}
}