From 8fa00e2ef698acda00df2dbf765cbe79748f9a6c Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Mon, 18 Mar 2024 17:48:57 +0000 Subject: [PATCH] Apply fixes from StyleCI --- .../Commands/CloudflarePurgeCommand.php | 6 +-- app/Console/Commands/UserCreateCommand.php | 15 +++--- app/Helpers/HelperFunctions.php | 6 +-- app/Http/Controllers/ChampionController.php | 4 +- .../Controllers/ChampionSkinController.php | 4 +- .../ContactSubmissionController.php | 2 +- .../Controllers/HTMLSitemapController.php | 2 - app/Http/Controllers/PostsController.php | 2 +- app/Http/Controllers/SaleController.php | 1 + .../Requests/ContactSubmissionRequest.php | 12 ++--- app/Models/Champion.php | 51 +++++++++---------- app/Models/ChampionSkin.php | 6 +-- app/Models/ContactSubmission.php | 2 +- app/Models/SkinChroma.php | 2 +- app/Models/SummonerIcon.php | 1 + app/Providers/AppServiceProvider.php | 2 - app/View/Components/Sales/Current_sales.php | 1 + app/View/Components/Skins/Paginatedlist.php | 2 +- bootstrap/app.php | 8 +-- config/HCaptcha.php | 6 +-- config/app.php | 1 - config/filesystems.php | 2 +- config/image.php | 2 +- config/sheets.php | 2 +- .../2014_10_12_000000_create_users_table.php | 3 +- ...000_create_password_reset_tokens_table.php | 3 +- ..._08_19_000000_create_failed_jobs_table.php | 3 +- ...01_create_personal_access_tokens_table.php | 3 +- .../2023_06_07_000001_create_pulse_tables.php | 5 +- ...23_10_25_180120_create_champions_table.php | 3 +- ..._26_175822_create_champion_skins_table.php | 3 +- ...10_27_080159_create_skin_chromas_table.php | 3 +- ...23_10_31_081816_fix_typo_championskins.php | 3 +- .../2023_10_31_084006_skin_price_type_fix.php | 3 +- .../2023_10_31_085408_make_lore_nullable.php | 3 +- ...1_01_080800_skin_chromas_add_chroma_id.php | 3 +- ..._01_134531_create_champion_roles_table.php | 3 +- ...023_11_01_135724_add_slug_to_champions.php | 3 +- ...1_01_140156_add_slug_to_champion_skins.php | 3 +- ..._11_01_140243_add_slug_to_skin_chromas.php | 3 +- ..._15_105425_create_summoner_icons_table.php | 3 +- ...26_175055_create_summoner_emotes_table.php | 3 +- .../2023_12_01_211507_add_admin_to_users.php | 3 +- ...62055_create_contact_submissions_table.php | 3 +- ...024_03_18_170123_create_sessions_table.php | 3 +- database/seeders/ChampionRolesSeeder.php | 14 ++--- database/seeders/ChampionSeeder.php | 6 +-- database/seeders/ChampionSkinSeeder.php | 8 +-- database/seeders/DatabaseSeeder.php | 4 +- database/seeders/SkinChromaSeeder.php | 8 +-- database/seeders/SummonerEmoteSeeder.php | 12 ++--- database/seeders/SummonerIconSeeder.php | 8 +-- public/index.php | 6 +-- rector.php | 2 +- routes/api.php | 1 - routes/console.php | 1 - routes/web.php | 2 +- 57 files changed, 148 insertions(+), 131 deletions(-) diff --git a/app/Console/Commands/CloudflarePurgeCommand.php b/app/Console/Commands/CloudflarePurgeCommand.php index bde3e92..4f5646d 100644 --- a/app/Console/Commands/CloudflarePurgeCommand.php +++ b/app/Console/Commands/CloudflarePurgeCommand.php @@ -2,9 +2,9 @@ namespace App\Console\Commands; +use GuzzleHttp\Client; use GuzzleHttp\Exception\GuzzleException; use Illuminate\Console\Command; -use GuzzleHttp\Client; use Illuminate\Support\Facades\App; class CloudflarePurgeCommand extends Command @@ -25,10 +25,10 @@ class CloudflarePurgeCommand extends Command $response = $client->request( 'POST', - "https://api.cloudflare.com/client/v4/zones/" . $cf_zone_id . "/purge_cache", + 'https://api.cloudflare.com/client/v4/zones/'.$cf_zone_id.'/purge_cache', [ 'headers' => [ - 'Authorization' => 'Bearer ' . $cf_auth_bearer, + 'Authorization' => 'Bearer '.$cf_auth_bearer, 'Content-Type' => 'application/json', ], 'json' => [ diff --git a/app/Console/Commands/UserCreateCommand.php b/app/Console/Commands/UserCreateCommand.php index 76de4eb..a352450 100644 --- a/app/Console/Commands/UserCreateCommand.php +++ b/app/Console/Commands/UserCreateCommand.php @@ -14,7 +14,7 @@ class UserCreateCommand extends Command public function handle(): void { if (config('app.env') === 'production') { - if (!$this->confirm('You are in production mode. Are you sure you want to continue?')) { + if (! $this->confirm('You are in production mode. Are you sure you want to continue?')) { return; } } @@ -27,14 +27,15 @@ class UserCreateCommand extends Command $password_confirmation = $this->secret('Confirm password'); $admin = $this->confirm('Is this user an admin?'); - $this->info('Name: ' . $name); - $this->info('Email: ' . $email); - $this->info('Password: ' . $password); - $this->info('Password confirmation: ' . $password_confirmation); - $this->info('Admin: ' . $admin); + $this->info('Name: '.$name); + $this->info('Email: '.$email); + $this->info('Password: '.$password); + $this->info('Password confirmation: '.$password_confirmation); + $this->info('Admin: '.$admin); if ($password !== $password_confirmation) { $this->error('Passwords do not match!'); + return; } @@ -45,6 +46,6 @@ class UserCreateCommand extends Command 'admin' => $admin, ]); - $this->info('User with name ' . $user->name . 'created successfully.'); + $this->info('User with name '.$user->name.'created successfully.'); } } diff --git a/app/Helpers/HelperFunctions.php b/app/Helpers/HelperFunctions.php index 7db6d3f..6424980 100644 --- a/app/Helpers/HelperFunctions.php +++ b/app/Helpers/HelperFunctions.php @@ -1,7 +1,7 @@ 'gm-support.png', ]; - return asset('img/' . $roleIcons[$roleName]); + return asset('img/'.$roleIcons[$roleName]); } function getAverageColorFromImageUrl($imageUrl): string @@ -45,7 +45,7 @@ function getAverageColorFromImageUrl($imageUrl): string $avgG = $totalG / $pixelCount; $avgB = $totalB / $pixelCount; - return sprintf("#%02x%02x%02x", $avgR, $avgG, $avgB); + return sprintf('#%02x%02x%02x', $avgR, $avgG, $avgB); } function getRoleIconSvg($roleName): string diff --git a/app/Http/Controllers/ChampionController.php b/app/Http/Controllers/ChampionController.php index d6500a2..b0f582f 100644 --- a/app/Http/Controllers/ChampionController.php +++ b/app/Http/Controllers/ChampionController.php @@ -48,10 +48,10 @@ class ChampionController extends Controller $threeDaysInSeconds = 60 * 60 * 24 * 3; $sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6; - $champion = Cache::remember('championShowCache' . $champion->slug, $threeDaysInSeconds, static fn () => $champion->load('skins', 'lanes')); + $champion = Cache::remember('championShowCache'.$champion->slug, $threeDaysInSeconds, static fn () => $champion->load('skins', 'lanes')); $splashColor = Cache::remember( - 'championSplashColorCache' . $champion->slug, + 'championSplashColorCache'.$champion->slug, $sixMonthsInSeconds, static fn () => getAverageColorFromImageUrl($champion->getChampionImageAttribute()) ); diff --git a/app/Http/Controllers/ChampionSkinController.php b/app/Http/Controllers/ChampionSkinController.php index deb07af..7ba6f19 100644 --- a/app/Http/Controllers/ChampionSkinController.php +++ b/app/Http/Controllers/ChampionSkinController.php @@ -55,13 +55,13 @@ class ChampionSkinController extends Controller public function show(ChampionSkin $championSkin) { $skin = Cache::remember( - 'championSkinShowCache' . $championSkin->slug, + 'championSkinShowCache'.$championSkin->slug, 60 * 60 * 48, static fn () => $championSkin->load('champion', 'chromas') ); $splashColor = Cache::remember( - 'championSkinSplashColorCache' . $championSkin->slug, + 'championSkinSplashColorCache'.$championSkin->slug, 60 * 60 * 120, static fn () => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute()) ); diff --git a/app/Http/Controllers/ContactSubmissionController.php b/app/Http/Controllers/ContactSubmissionController.php index 2009084..391cb12 100644 --- a/app/Http/Controllers/ContactSubmissionController.php +++ b/app/Http/Controllers/ContactSubmissionController.php @@ -28,7 +28,7 @@ class ContactSubmissionController extends Controller 'title' => "{$contactSubmission->category->humanReadable()} - {$contactSubmission->subject}", 'description' => $descriptionContent, 'color' => '#ff8a4c', - ] + ], ]); return redirect()->route('contact.index')->with('success', 'Your message has been sent!'); diff --git a/app/Http/Controllers/HTMLSitemapController.php b/app/Http/Controllers/HTMLSitemapController.php index 9148584..76e299f 100644 --- a/app/Http/Controllers/HTMLSitemapController.php +++ b/app/Http/Controllers/HTMLSitemapController.php @@ -6,7 +6,6 @@ use App\Models\Champion; use App\Models\ChampionSkin; use App\Models\SummonerIcon; use Illuminate\Support\Facades\Cache; - use Spatie\Sheets\Facades\Sheets; class HTMLSitemapController extends Controller @@ -20,7 +19,6 @@ class HTMLSitemapController extends Controller $icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get()); $posts = Sheets::all()->sortByDesc('date'); - return view('sitemap.index', compact('champions', 'skins', 'icons', 'posts')); } } diff --git a/app/Http/Controllers/PostsController.php b/app/Http/Controllers/PostsController.php index 7582c2b..76ad576 100644 --- a/app/Http/Controllers/PostsController.php +++ b/app/Http/Controllers/PostsController.php @@ -2,9 +2,9 @@ namespace App\Http\Controllers; +use CreativeCrafts\Paginate\Facades\Paginate; use Spatie\Sheets\Facades\Sheets; use Spatie\Sheets\Sheet; -use CreativeCrafts\Paginate\Facades\Paginate; class PostsController extends Controller { diff --git a/app/Http/Controllers/SaleController.php b/app/Http/Controllers/SaleController.php index 71f8156..44bd4f4 100644 --- a/app/Http/Controllers/SaleController.php +++ b/app/Http/Controllers/SaleController.php @@ -14,6 +14,7 @@ class SaleController extends Controller true ); $salesData = array_filter($shopData, static fn ($collection) => $collection['path'] === '/event/sales'); + return reset($salesData)['dynamicCollection']['discountedProductsByProductType'] ?? []; }); diff --git a/app/Http/Requests/ContactSubmissionRequest.php b/app/Http/Requests/ContactSubmissionRequest.php index d20c1bf..6b16a6d 100644 --- a/app/Http/Requests/ContactSubmissionRequest.php +++ b/app/Http/Requests/ContactSubmissionRequest.php @@ -9,13 +9,13 @@ class ContactSubmissionRequest extends FormRequest public function rules(): array { return [ - 'name' => ['required', 'max:254'], - 'email' => ['required', 'email', 'max:254'], - 'discord' => ['nullable', 'min:2', 'max:35'], + 'name' => ['required', 'max:254'], + 'email' => ['required', 'email', 'max:254'], + 'discord' => ['nullable', 'min:2', 'max:35'], 'category' => ['required', 'in:question,advertising,bug_report,feedback,other'], - 'subject' => ['required', 'max:254'], - 'message' => ['required', 'unique:contact_submissions', 'max:3500'], - 'h-captcha-response' => 'required|HCaptcha' + 'subject' => ['required', 'max:254'], + 'message' => ['required', 'unique:contact_submissions', 'max:3500'], + 'h-captcha-response' => 'required|HCaptcha', ]; } diff --git a/app/Models/Champion.php b/app/Models/Champion.php index 2a79dca..3e9e49b 100644 --- a/app/Models/Champion.php +++ b/app/Models/Champion.php @@ -39,21 +39,21 @@ class Champion extends Model public function getResourceTypeAttribute($value): string { $resourceTypes = [ - 'BLOOD_WELL' => "Blood", - "MANA" => "Mana", - "ENERGY" => "Energy", - "NONE" => "None", - "HEALTH" => "Health", - "RAGE" => "Rage", - "COURAGE" => "Courage", - "SHIELD" => "Shield", - "FURY" => "Fury", - "FEROCITY" => "Ferocity", - "HEAT" => "Heat", - "GRIT" => "Grit", - "BLOODTHIRST" => "Bloodthirst", - "FLOW" => "Flow", - "SOUL_UNBOUND" => "Soul Unbound", + 'BLOOD_WELL' => 'Blood', + 'MANA' => 'Mana', + 'ENERGY' => 'Energy', + 'NONE' => 'None', + 'HEALTH' => 'Health', + 'RAGE' => 'Rage', + 'COURAGE' => 'Courage', + 'SHIELD' => 'Shield', + 'FURY' => 'Fury', + 'FEROCITY' => 'Ferocity', + 'HEAT' => 'Heat', + 'GRIT' => 'Grit', + 'BLOODTHIRST' => 'Bloodthirst', + 'FLOW' => 'Flow', + 'SOUL_UNBOUND' => 'Soul Unbound', ]; return $resourceTypes[$value]; @@ -96,49 +96,48 @@ class Champion extends Model public function getChampionImageAttribute($centered = true): string { - $url = 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/splash-art'; + $url = 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/splash-art'; - return $centered ? $url . '/centered' : $url; + return $centered ? $url.'/centered' : $url; } - public function getChampionImageLoadingAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/portrait'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/portrait'; } public function getChampionImageTileAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/tile'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/tile'; } public function getChampionSquareImageAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/square'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/square'; } public function getChampionAbilityIconQAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/q'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/q'; } public function getChampionAbilityIconWAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/w'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/w'; } public function getChampionAbilityIconEAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/e'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/e'; } public function getChampionAbilityIconRAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/r'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/r'; } public function getChampionAbilityIconPAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/ability-icon/p'; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/ability-icon/p'; } } diff --git a/app/Models/ChampionSkin.php b/app/Models/ChampionSkin.php index 5cd2867..eac569d 100644 --- a/app/Models/ChampionSkin.php +++ b/app/Models/ChampionSkin.php @@ -74,16 +74,16 @@ class ChampionSkin extends Model public function getSkinImageAttribute(): string { - return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/' . $this->champion_id . '/' . $this->full_skin_id . '.jpg'; + return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-splashes/'.$this->champion_id.'/'.$this->full_skin_id.'.jpg'; } public function getSkinImageLoadingAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/portrait/skin/' . $this->skin_id; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/portrait/skin/'.$this->skin_id; } public function getSkinImageTileAttribute(): string { - return 'https://cdn.communitydragon.org/latest/champion/' . $this->champion_id . '/tile/skin/' . $this->skin_id; + return 'https://cdn.communitydragon.org/latest/champion/'.$this->champion_id.'/tile/skin/'.$this->skin_id; } } diff --git a/app/Models/ContactSubmission.php b/app/Models/ContactSubmission.php index 28a00a9..562f11e 100644 --- a/app/Models/ContactSubmission.php +++ b/app/Models/ContactSubmission.php @@ -2,8 +2,8 @@ namespace App\Models; -use Illuminate\Database\Eloquent\Model; use App\Enums\ContactCategory; +use Illuminate\Database\Eloquent\Model; class ContactSubmission extends Model { diff --git a/app/Models/SkinChroma.php b/app/Models/SkinChroma.php index 50bebcf..5c768d5 100644 --- a/app/Models/SkinChroma.php +++ b/app/Models/SkinChroma.php @@ -43,6 +43,6 @@ class SkinChroma extends Model public function getChromaImageAttribute() { - return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-chroma-images/' . $this->skin->champion_id . '/' . $this->chroma_id . '.png'; + return 'https://raw.communitydragon.org/pbe/plugins/rcp-be-lol-game-data/global/default/v1/champion-chroma-images/'.$this->skin->champion_id.'/'.$this->chroma_id.'.png'; } } diff --git a/app/Models/SummonerIcon.php b/app/Models/SummonerIcon.php index 65fe381..55f70b6 100644 --- a/app/Models/SummonerIcon.php +++ b/app/Models/SummonerIcon.php @@ -41,6 +41,7 @@ class SummonerIcon extends Model public function getSqidAttribute(): string { $sqids = new Sqids(minLength: 5); + return $sqids->encode([$this->icon_id]); } diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 19292d6..ea69488 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -57,8 +57,6 @@ class AppServiceProvider extends ServiceProvider return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); }); - - Route::bind('post', function ($path) { return $this->app->make(Sheets::class) ->collection('posts') diff --git a/app/View/Components/Sales/Current_sales.php b/app/View/Components/Sales/Current_sales.php index c5bed92..b369906 100644 --- a/app/View/Components/Sales/Current_sales.php +++ b/app/View/Components/Sales/Current_sales.php @@ -10,6 +10,7 @@ class Current_sales extends Component public function __construct(public array $sales) { } + public function render(): View { return view('components.sales.current_sales'); diff --git a/app/View/Components/Skins/Paginatedlist.php b/app/View/Components/Skins/Paginatedlist.php index 3837301..e80d781 100644 --- a/app/View/Components/Skins/Paginatedlist.php +++ b/app/View/Components/Skins/Paginatedlist.php @@ -3,8 +3,8 @@ namespace App\View\Components\Skins; use Illuminate\Contracts\View\View; -use Illuminate\View\Component; use Illuminate\Pagination\LengthAwarePaginator as Paginator; +use Illuminate\View\Component; class Paginatedlist extends Component { diff --git a/bootstrap/app.php b/bootstrap/app.php index 0aeb3fb..7d59fc2 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -10,10 +10,10 @@ return Application::configure(basePath: dirname(__DIR__)) \Scyllaly\HCaptcha\HCaptchaServiceProvider::class, ]) ->withRouting( - web: __DIR__ . '/../routes/web.php', - api: __DIR__ . '/../routes/api.php', - commands: __DIR__ . '/../routes/console.php', - channels: __DIR__ . '/../routes/channels.php', + web: __DIR__.'/../routes/web.php', + api: __DIR__.'/../routes/api.php', + commands: __DIR__.'/../routes/console.php', + channels: __DIR__.'/../routes/channels.php', health: '/up', ) ->withMiddleware(function (Middleware $middleware) { diff --git a/config/HCaptcha.php b/config/HCaptcha.php index a58a2fb..ea1743e 100644 --- a/config/HCaptcha.php +++ b/config/HCaptcha.php @@ -1,10 +1,10 @@ env('HCAPTCHA_SECRET'), - 'sitekey' => env('HCAPTCHA_SITEKEY'), + 'secret' => env('HCAPTCHA_SECRET'), + 'sitekey' => env('HCAPTCHA_SITEKEY'), 'server-get-config' => false, - 'options' => [ + 'options' => [ 'timeout' => 30, ], ]; diff --git a/config/app.php b/config/app.php index 6e65374..5c93d37 100644 --- a/config/app.php +++ b/config/app.php @@ -6,7 +6,6 @@ return [ 'login_route' => env('LOGIN_ROUTE_NAME', 'login'), - 'aliases' => Facade::defaultAliases()->merge([ 'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class, // 'Example' => App\Facades\Example::class, diff --git a/config/filesystems.php b/config/filesystems.php index 05421f7..f64c847 100644 --- a/config/filesystems.php +++ b/config/filesystems.php @@ -19,7 +19,7 @@ return [ 'posts' => [ 'driver' => 'local', 'root' => base_path('content/posts'), - ] + ], ], ]; diff --git a/config/image.php b/config/image.php index 2b1d2c3..6798381 100644 --- a/config/image.php +++ b/config/image.php @@ -15,6 +15,6 @@ return [ | */ - 'driver' => 'gd' + 'driver' => 'gd', ]; diff --git a/config/sheets.php b/config/sheets.php index 451412c..a1fdccb 100644 --- a/config/sheets.php +++ b/config/sheets.php @@ -9,6 +9,6 @@ return [ 'path_parser' => Spatie\Sheets\PathParsers\SlugParser::class, 'content_parser' => Spatie\Sheets\ContentParsers\MarkdownWithFrontMatterParser::class, 'extension' => 'md', - ] + ], ], ]; diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 6c2b6d5..1f97419 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php b/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php index d8336e7..8b5b388 100644 --- a/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php +++ b/database/migrations/2014_10_12_100000_create_password_reset_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php index 667f82c..3eec77b 100644 --- a/database/migrations/2019_08_19_000000_create_failed_jobs_table.php +++ b/database/migrations/2019_08_19_000000_create_failed_jobs_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php index 668cd96..0fc7a63 100644 --- a/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php +++ b/database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_06_07_000001_create_pulse_tables.php b/database/migrations/2023_06_07_000001_create_pulse_tables.php index 27a94a6..9ea0ebe 100644 --- a/database/migrations/2023_06_07_000001_create_pulse_tables.php +++ b/database/migrations/2023_06_07_000001_create_pulse_tables.php @@ -4,13 +4,14 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; use Laravel\Pulse\Support\PulseMigration; -return new class () extends PulseMigration { +return new class() extends PulseMigration +{ /** * Run the migrations. */ public function up(): void { - if (!$this->shouldRun()) { + if (! $this->shouldRun()) { return; } diff --git a/database/migrations/2023_10_25_180120_create_champions_table.php b/database/migrations/2023_10_25_180120_create_champions_table.php index caccbb7..70670d2 100644 --- a/database/migrations/2023_10_25_180120_create_champions_table.php +++ b/database/migrations/2023_10_25_180120_create_champions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_10_26_175822_create_champion_skins_table.php b/database/migrations/2023_10_26_175822_create_champion_skins_table.php index 7b601a0..0f9b308 100644 --- a/database/migrations/2023_10_26_175822_create_champion_skins_table.php +++ b/database/migrations/2023_10_26_175822_create_champion_skins_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_10_27_080159_create_skin_chromas_table.php b/database/migrations/2023_10_27_080159_create_skin_chromas_table.php index 21d3a50..baa7b4a 100644 --- a/database/migrations/2023_10_27_080159_create_skin_chromas_table.php +++ b/database/migrations/2023_10_27_080159_create_skin_chromas_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_10_31_081816_fix_typo_championskins.php b/database/migrations/2023_10_31_081816_fix_typo_championskins.php index 09aa6db..11428c4 100644 --- a/database/migrations/2023_10_31_081816_fix_typo_championskins.php +++ b/database/migrations/2023_10_31_081816_fix_typo_championskins.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_10_31_084006_skin_price_type_fix.php b/database/migrations/2023_10_31_084006_skin_price_type_fix.php index 44fa2c6..90cd368 100644 --- a/database/migrations/2023_10_31_084006_skin_price_type_fix.php +++ b/database/migrations/2023_10_31_084006_skin_price_type_fix.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_10_31_085408_make_lore_nullable.php b/database/migrations/2023_10_31_085408_make_lore_nullable.php index f71d3bc..8ab1a8b 100644 --- a/database/migrations/2023_10_31_085408_make_lore_nullable.php +++ b/database/migrations/2023_10_31_085408_make_lore_nullable.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_01_080800_skin_chromas_add_chroma_id.php b/database/migrations/2023_11_01_080800_skin_chromas_add_chroma_id.php index 68cd2bc..06e86ee 100644 --- a/database/migrations/2023_11_01_080800_skin_chromas_add_chroma_id.php +++ b/database/migrations/2023_11_01_080800_skin_chromas_add_chroma_id.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_01_134531_create_champion_roles_table.php b/database/migrations/2023_11_01_134531_create_champion_roles_table.php index 72575f3..0ebfd3c 100644 --- a/database/migrations/2023_11_01_134531_create_champion_roles_table.php +++ b/database/migrations/2023_11_01_134531_create_champion_roles_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_01_135724_add_slug_to_champions.php b/database/migrations/2023_11_01_135724_add_slug_to_champions.php index bcd6371..6a76a7c 100644 --- a/database/migrations/2023_11_01_135724_add_slug_to_champions.php +++ b/database/migrations/2023_11_01_135724_add_slug_to_champions.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php b/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php index 3c0e18e..a36cbc3 100644 --- a/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php +++ b/database/migrations/2023_11_01_140156_add_slug_to_champion_skins.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php b/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php index f7613fa..7e593aa 100644 --- a/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php +++ b/database/migrations/2023_11_01_140243_add_slug_to_skin_chromas.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/migrations/2023_11_15_105425_create_summoner_icons_table.php b/database/migrations/2023_11_15_105425_create_summoner_icons_table.php index 964a5a9..44beae4 100644 --- a/database/migrations/2023_11_15_105425_create_summoner_icons_table.php +++ b/database/migrations/2023_11_15_105425_create_summoner_icons_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ public function up(): void { Schema::create('summoner_icons', function (Blueprint $table) { diff --git a/database/migrations/2023_11_26_175055_create_summoner_emotes_table.php b/database/migrations/2023_11_26_175055_create_summoner_emotes_table.php index 700e760..85e40e2 100644 --- a/database/migrations/2023_11_26_175055_create_summoner_emotes_table.php +++ b/database/migrations/2023_11_26_175055_create_summoner_emotes_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ public function up(): void { Schema::create('summoner_emotes', function (Blueprint $table) { diff --git a/database/migrations/2023_12_01_211507_add_admin_to_users.php b/database/migrations/2023_12_01_211507_add_admin_to_users.php index 385a1d9..3b57e1e 100644 --- a/database/migrations/2023_12_01_211507_add_admin_to_users.php +++ b/database/migrations/2023_12_01_211507_add_admin_to_users.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ public function up(): void { Schema::table('users', function (Blueprint $table) { diff --git a/database/migrations/2024_02_24_162055_create_contact_submissions_table.php b/database/migrations/2024_02_24_162055_create_contact_submissions_table.php index a9f0419..e0c57ac 100644 --- a/database/migrations/2024_02_24_162055_create_contact_submissions_table.php +++ b/database/migrations/2024_02_24_162055_create_contact_submissions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ public function up(): void { Schema::create('contact_submissions', function (Blueprint $table) { diff --git a/database/migrations/2024_03_18_170123_create_sessions_table.php b/database/migrations/2024_03_18_170123_create_sessions_table.php index 2b2306a..a2e43a3 100644 --- a/database/migrations/2024_03_18_170123_create_sessions_table.php +++ b/database/migrations/2024_03_18_170123_create_sessions_table.php @@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -return new class () extends Migration { +return new class() extends Migration +{ /** * Run the migrations. */ diff --git a/database/seeders/ChampionRolesSeeder.php b/database/seeders/ChampionRolesSeeder.php index 9bc7fcb..553b12a 100644 --- a/database/seeders/ChampionRolesSeeder.php +++ b/database/seeders/ChampionRolesSeeder.php @@ -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++; } diff --git a/database/seeders/ChampionSeeder.php b/database/seeders/ChampionSeeder.php index 35b1e6c..05ac418 100644 --- a/database/seeders/ChampionSeeder.php +++ b/database/seeders/ChampionSeeder.php @@ -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++; } diff --git a/database/seeders/ChampionSkinSeeder.php b/database/seeders/ChampionSkinSeeder.php index ba92833..d3a1a99 100644 --- a/database/seeders/ChampionSkinSeeder.php +++ b/database/seeders/ChampionSkinSeeder.php @@ -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++; } diff --git a/database/seeders/DatabaseSeeder.php b/database/seeders/DatabaseSeeder.php index 751967e..c6ee975 100644 --- a/database/seeders/DatabaseSeeder.php +++ b/database/seeders/DatabaseSeeder.php @@ -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')); } } diff --git a/database/seeders/SkinChromaSeeder.php b/database/seeders/SkinChromaSeeder.php index 99484ac..4ed6e10 100644 --- a/database/seeders/SkinChromaSeeder.php +++ b/database/seeders/SkinChromaSeeder.php @@ -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++; } diff --git a/database/seeders/SummonerEmoteSeeder.php b/database/seeders/SummonerEmoteSeeder.php index 7b0a181..f6d8c0b 100644 --- a/database/seeders/SummonerEmoteSeeder.php +++ b/database/seeders/SummonerEmoteSeeder.php @@ -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++; } diff --git a/database/seeders/SummonerIconSeeder.php b/database/seeders/SummonerIconSeeder.php index e5b5a22..cf3f29c 100644 --- a/database/seeders/SummonerIconSeeder.php +++ b/database/seeders/SummonerIconSeeder.php @@ -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++; } diff --git a/public/index.php b/public/index.php index 74a0960..947d989 100644 --- a/public/index.php +++ b/public/index.php @@ -5,13 +5,13 @@ use Illuminate\Http\Request; define('LARAVEL_START', microtime(true)); // Determine if the application is in maintenance mode... -if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) { +if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { require $maintenance; } // Register the Composer autoloader... -require __DIR__ . '/../vendor/autoload.php'; +require __DIR__.'/../vendor/autoload.php'; // Bootstrap Laravel and handle the request... -(require_once __DIR__ . '/../bootstrap/app.php') +(require_once __DIR__.'/../bootstrap/app.php') ->handleRequest(Request::capture()); diff --git a/rector.php b/rector.php index 08ad538..ba0dfa4 100644 --- a/rector.php +++ b/rector.php @@ -17,6 +17,6 @@ return static function (RectorConfig $rectorConfig): void { SetList::DEAD_CODE, SetList::EARLY_RETURN, SetList::STRICT_BOOLEANS, - LevelSetList::UP_TO_PHP_82 + LevelSetList::UP_TO_PHP_82, ]); }; diff --git a/routes/api.php b/routes/api.php index 585bad2..a2a44f1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -1,6 +1,5 @@ twiceDaily(1, 13)->timezone('Europe/Amsterdam'); Schedule::command('sitemap:generate')->weekly(); diff --git a/routes/web.php b/routes/web.php index 6853f21..215e529 100644 --- a/routes/web.php +++ b/routes/web.php @@ -16,8 +16,8 @@ use App\Http\Requests\ContactSubmissionRequest; use App\Models\Champion; use App\Models\SummonerIcon; use Illuminate\Support\Facades\Route; -use Spatie\Sheets\Sheet; use Spatie\Honeypot\ProtectAgainstSpam; +use Spatie\Sheets\Sheet; /* |--------------------------------------------------------------------------