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 App\Console\Commands; namespace App\Console\Commands;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException; use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command; use Illuminate\Console\Command;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\App; use Illuminate\Support\Facades\App;
class CloudflarePurgeCommand extends Command class CloudflarePurgeCommand extends Command
@@ -25,10 +25,10 @@ class CloudflarePurgeCommand extends Command
$response = $client->request( $response = $client->request(
'POST', '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' => [ 'headers' => [
'Authorization' => 'Bearer ' . $cf_auth_bearer, 'Authorization' => 'Bearer '.$cf_auth_bearer,
'Content-Type' => 'application/json', 'Content-Type' => 'application/json',
], ],
'json' => [ 'json' => [

View File

@@ -14,7 +14,7 @@ class UserCreateCommand extends Command
public function handle(): void public function handle(): void
{ {
if (config('app.env') === 'production') { 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; return;
} }
} }
@@ -27,14 +27,15 @@ class UserCreateCommand extends Command
$password_confirmation = $this->secret('Confirm password'); $password_confirmation = $this->secret('Confirm password');
$admin = $this->confirm('Is this user an admin?'); $admin = $this->confirm('Is this user an admin?');
$this->info('Name: ' . $name); $this->info('Name: '.$name);
$this->info('Email: ' . $email); $this->info('Email: '.$email);
$this->info('Password: ' . $password); $this->info('Password: '.$password);
$this->info('Password confirmation: ' . $password_confirmation); $this->info('Password confirmation: '.$password_confirmation);
$this->info('Admin: ' . $admin); $this->info('Admin: '.$admin);
if ($password !== $password_confirmation) { if ($password !== $password_confirmation) {
$this->error('Passwords do not match!'); $this->error('Passwords do not match!');
return; return;
} }
@@ -45,6 +46,6 @@ class UserCreateCommand extends Command
'admin' => $admin, 'admin' => $admin,
]); ]);
$this->info('User with name ' . $user->name . 'created successfully.'); $this->info('User with name '.$user->name.'created successfully.');
} }
} }

View File

@@ -1,7 +1,7 @@
<?php <?php
use Intervention\Image\ImageManager;
use Intervention\Image\Drivers\Gd\Driver; use Intervention\Image\Drivers\Gd\Driver;
use Intervention\Image\ImageManager;
function getRoleIcon($roleName): string function getRoleIcon($roleName): string
{ {
@@ -13,7 +13,7 @@ function getRoleIcon($roleName): string
'Support' => 'gm-support.png', 'Support' => 'gm-support.png',
]; ];
return asset('img/' . $roleIcons[$roleName]); return asset('img/'.$roleIcons[$roleName]);
} }
function getAverageColorFromImageUrl($imageUrl): string function getAverageColorFromImageUrl($imageUrl): string
@@ -45,7 +45,7 @@ function getAverageColorFromImageUrl($imageUrl): string
$avgG = $totalG / $pixelCount; $avgG = $totalG / $pixelCount;
$avgB = $totalB / $pixelCount; $avgB = $totalB / $pixelCount;
return sprintf("#%02x%02x%02x", $avgR, $avgG, $avgB); return sprintf('#%02x%02x%02x', $avgR, $avgG, $avgB);
} }
function getRoleIconSvg($roleName): string function getRoleIconSvg($roleName): string

View File

@@ -48,10 +48,10 @@ class ChampionController extends Controller
$threeDaysInSeconds = 60 * 60 * 24 * 3; $threeDaysInSeconds = 60 * 60 * 24 * 3;
$sixMonthsInSeconds = 60 * 60 * 24 * 30 * 6; $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( $splashColor = Cache::remember(
'championSplashColorCache' . $champion->slug, 'championSplashColorCache'.$champion->slug,
$sixMonthsInSeconds, $sixMonthsInSeconds,
static fn () => getAverageColorFromImageUrl($champion->getChampionImageAttribute()) static fn () => getAverageColorFromImageUrl($champion->getChampionImageAttribute())
); );

View File

@@ -55,13 +55,13 @@ class ChampionSkinController extends Controller
public function show(ChampionSkin $championSkin) public function show(ChampionSkin $championSkin)
{ {
$skin = Cache::remember( $skin = Cache::remember(
'championSkinShowCache' . $championSkin->slug, 'championSkinShowCache'.$championSkin->slug,
60 * 60 * 48, 60 * 60 * 48,
static fn () => $championSkin->load('champion', 'chromas') static fn () => $championSkin->load('champion', 'chromas')
); );
$splashColor = Cache::remember( $splashColor = Cache::remember(
'championSkinSplashColorCache' . $championSkin->slug, 'championSkinSplashColorCache'.$championSkin->slug,
60 * 60 * 120, 60 * 60 * 120,
static fn () => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute()) static fn () => getAverageColorFromImageUrl($championSkin->getSkinImageAttribute())
); );

View File

@@ -28,7 +28,7 @@ class ContactSubmissionController extends Controller
'title' => "{$contactSubmission->category->humanReadable()} - {$contactSubmission->subject}", 'title' => "{$contactSubmission->category->humanReadable()} - {$contactSubmission->subject}",
'description' => $descriptionContent, 'description' => $descriptionContent,
'color' => '#ff8a4c', 'color' => '#ff8a4c',
] ],
]); ]);
return redirect()->route('contact.index')->with('success', 'Your message has been sent!'); return redirect()->route('contact.index')->with('success', 'Your message has been sent!');

View File

@@ -6,7 +6,6 @@ use App\Models\Champion;
use App\Models\ChampionSkin; use App\Models\ChampionSkin;
use App\Models\SummonerIcon; use App\Models\SummonerIcon;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Spatie\Sheets\Facades\Sheets; use Spatie\Sheets\Facades\Sheets;
class HTMLSitemapController extends Controller class HTMLSitemapController extends Controller
@@ -20,7 +19,6 @@ class HTMLSitemapController extends Controller
$icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get()); $icons = Cache::remember('sitemap_iconsCache', $twentyHoursInSeconds, fn () => SummonerIcon::orderBy('title')->get());
$posts = Sheets::all()->sortByDesc('date'); $posts = Sheets::all()->sortByDesc('date');
return view('sitemap.index', compact('champions', 'skins', 'icons', 'posts')); return view('sitemap.index', compact('champions', 'skins', 'icons', 'posts'));
} }
} }

View File

@@ -2,9 +2,9 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use CreativeCrafts\Paginate\Facades\Paginate;
use Spatie\Sheets\Facades\Sheets; use Spatie\Sheets\Facades\Sheets;
use Spatie\Sheets\Sheet; use Spatie\Sheets\Sheet;
use CreativeCrafts\Paginate\Facades\Paginate;
class PostsController extends Controller class PostsController extends Controller
{ {

View File

@@ -14,6 +14,7 @@ class SaleController extends Controller
true true
); );
$salesData = array_filter($shopData, static fn ($collection) => $collection['path'] === '/event/sales'); $salesData = array_filter($shopData, static fn ($collection) => $collection['path'] === '/event/sales');
return reset($salesData)['dynamicCollection']['discountedProductsByProductType'] ?? []; return reset($salesData)['dynamicCollection']['discountedProductsByProductType'] ?? [];
}); });

View File

@@ -9,13 +9,13 @@ class ContactSubmissionRequest extends FormRequest
public function rules(): array public function rules(): array
{ {
return [ return [
'name' => ['required', 'max:254'], 'name' => ['required', 'max:254'],
'email' => ['required', 'email', 'max:254'], 'email' => ['required', 'email', 'max:254'],
'discord' => ['nullable', 'min:2', 'max:35'], 'discord' => ['nullable', 'min:2', 'max:35'],
'category' => ['required', 'in:question,advertising,bug_report,feedback,other'], 'category' => ['required', 'in:question,advertising,bug_report,feedback,other'],
'subject' => ['required', 'max:254'], 'subject' => ['required', 'max:254'],
'message' => ['required', 'unique:contact_submissions', 'max:3500'], 'message' => ['required', 'unique:contact_submissions', 'max:3500'],
'h-captcha-response' => 'required|HCaptcha' 'h-captcha-response' => 'required|HCaptcha',
]; ];
} }

View File

@@ -39,21 +39,21 @@ class Champion extends Model
public function getResourceTypeAttribute($value): string public function getResourceTypeAttribute($value): string
{ {
$resourceTypes = [ $resourceTypes = [
'BLOOD_WELL' => "Blood", 'BLOOD_WELL' => 'Blood',
"MANA" => "Mana", 'MANA' => 'Mana',
"ENERGY" => "Energy", 'ENERGY' => 'Energy',
"NONE" => "None", 'NONE' => 'None',
"HEALTH" => "Health", 'HEALTH' => 'Health',
"RAGE" => "Rage", 'RAGE' => 'Rage',
"COURAGE" => "Courage", 'COURAGE' => 'Courage',
"SHIELD" => "Shield", 'SHIELD' => 'Shield',
"FURY" => "Fury", 'FURY' => 'Fury',
"FEROCITY" => "Ferocity", 'FEROCITY' => 'Ferocity',
"HEAT" => "Heat", 'HEAT' => 'Heat',
"GRIT" => "Grit", 'GRIT' => 'Grit',
"BLOODTHIRST" => "Bloodthirst", 'BLOODTHIRST' => 'Bloodthirst',
"FLOW" => "Flow", 'FLOW' => 'Flow',
"SOUL_UNBOUND" => "Soul Unbound", 'SOUL_UNBOUND' => 'Soul Unbound',
]; ];
return $resourceTypes[$value]; return $resourceTypes[$value];
@@ -96,49 +96,48 @@ class Champion extends Model
public function getChampionImageAttribute($centered = true): string 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 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 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 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 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 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 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 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 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';
} }
} }

View File

@@ -74,16 +74,16 @@ class ChampionSkin extends Model
public function getSkinImageAttribute(): string 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 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 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;
} }
} }

View File

@@ -2,8 +2,8 @@
namespace App\Models; namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use App\Enums\ContactCategory; use App\Enums\ContactCategory;
use Illuminate\Database\Eloquent\Model;
class ContactSubmission extends Model class ContactSubmission extends Model
{ {

View File

@@ -43,6 +43,6 @@ class SkinChroma extends Model
public function getChromaImageAttribute() 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';
} }
} }

View File

@@ -41,6 +41,7 @@ class SummonerIcon extends Model
public function getSqidAttribute(): string public function getSqidAttribute(): string
{ {
$sqids = new Sqids(minLength: 5); $sqids = new Sqids(minLength: 5);
return $sqids->encode([$this->icon_id]); return $sqids->encode([$this->icon_id]);
} }

View File

@@ -57,8 +57,6 @@ class AppServiceProvider extends ServiceProvider
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip()); return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
}); });
Route::bind('post', function ($path) { Route::bind('post', function ($path) {
return $this->app->make(Sheets::class) return $this->app->make(Sheets::class)
->collection('posts') ->collection('posts')

View File

@@ -10,6 +10,7 @@ class Current_sales extends Component
public function __construct(public array $sales) public function __construct(public array $sales)
{ {
} }
public function render(): View public function render(): View
{ {
return view('components.sales.current_sales'); return view('components.sales.current_sales');

View File

@@ -3,8 +3,8 @@
namespace App\View\Components\Skins; namespace App\View\Components\Skins;
use Illuminate\Contracts\View\View; use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
use Illuminate\Pagination\LengthAwarePaginator as Paginator; use Illuminate\Pagination\LengthAwarePaginator as Paginator;
use Illuminate\View\Component;
class Paginatedlist extends Component class Paginatedlist extends Component
{ {

View File

@@ -10,10 +10,10 @@ return Application::configure(basePath: dirname(__DIR__))
\Scyllaly\HCaptcha\HCaptchaServiceProvider::class, \Scyllaly\HCaptcha\HCaptchaServiceProvider::class,
]) ])
->withRouting( ->withRouting(
web: __DIR__ . '/../routes/web.php', web: __DIR__.'/../routes/web.php',
api: __DIR__ . '/../routes/api.php', api: __DIR__.'/../routes/api.php',
commands: __DIR__ . '/../routes/console.php', commands: __DIR__.'/../routes/console.php',
channels: __DIR__ . '/../routes/channels.php', channels: __DIR__.'/../routes/channels.php',
health: '/up', health: '/up',
) )
->withMiddleware(function (Middleware $middleware) { ->withMiddleware(function (Middleware $middleware) {

View File

@@ -1,10 +1,10 @@
<?php <?php
return [ return [
'secret' => env('HCAPTCHA_SECRET'), 'secret' => env('HCAPTCHA_SECRET'),
'sitekey' => env('HCAPTCHA_SITEKEY'), 'sitekey' => env('HCAPTCHA_SITEKEY'),
'server-get-config' => false, 'server-get-config' => false,
'options' => [ 'options' => [
'timeout' => 30, 'timeout' => 30,
], ],
]; ];

View File

@@ -6,7 +6,6 @@ return [
'login_route' => env('LOGIN_ROUTE_NAME', 'login'), 'login_route' => env('LOGIN_ROUTE_NAME', 'login'),
'aliases' => Facade::defaultAliases()->merge([ 'aliases' => Facade::defaultAliases()->merge([
'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class, 'HCaptcha' => Scyllaly\HCaptcha\Facades\HCaptcha::class,
// 'Example' => App\Facades\Example::class, // 'Example' => App\Facades\Example::class,

View File

@@ -19,7 +19,7 @@ return [
'posts' => [ 'posts' => [
'driver' => 'local', 'driver' => 'local',
'root' => base_path('content/posts'), 'root' => base_path('content/posts'),
] ],
], ],
]; ];

View File

@@ -15,6 +15,6 @@ return [
| |
*/ */
'driver' => 'gd' 'driver' => 'gd',
]; ];

View File

@@ -9,6 +9,6 @@ return [
'path_parser' => Spatie\Sheets\PathParsers\SlugParser::class, 'path_parser' => Spatie\Sheets\PathParsers\SlugParser::class,
'content_parser' => Spatie\Sheets\ContentParsers\MarkdownWithFrontMatterParser::class, 'content_parser' => Spatie\Sheets\ContentParsers\MarkdownWithFrontMatterParser::class,
'extension' => 'md', 'extension' => 'md',
] ],
], ],
]; ];

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,13 +4,14 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
use Laravel\Pulse\Support\PulseMigration; use Laravel\Pulse\Support\PulseMigration;
return new class () extends PulseMigration { return new class() extends PulseMigration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */
public function up(): void public function up(): void
{ {
if (!$this->shouldRun()) { if (! $this->shouldRun()) {
return; return;
} }

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('summoner_icons', function (Blueprint $table) { Schema::create('summoner_icons', function (Blueprint $table) {

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('summoner_emotes', function (Blueprint $table) { Schema::create('summoner_emotes', function (Blueprint $table) {

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
public function up(): void public function up(): void
{ {
Schema::table('users', function (Blueprint $table) { Schema::table('users', function (Blueprint $table) {

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
public function up(): void public function up(): void
{ {
Schema::create('contact_submissions', function (Blueprint $table) { Schema::create('contact_submissions', function (Blueprint $table) {

View File

@@ -4,7 +4,8 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema; use Illuminate\Support\Facades\Schema;
return new class () extends Migration { return new class() extends Migration
{
/** /**
* Run the migrations. * Run the migrations.
*/ */

View File

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

View File

@@ -36,7 +36,7 @@ class ChampionSkinSeeder extends Seeder
'champion_id' => $champion['id'], 'champion_id' => $champion['id'],
'full_skin_id' => $skin['id'], 'full_skin_id' => $skin['id'],
'skin_id' => substr($skin['id'], 3), 'skin_id' => substr($skin['id'], 3),
'skin_name' => $skin['name'] . ' ' . $champion['name'], 'skin_name' => $skin['name'].' '.$champion['name'],
'lore' => $skin['lore'], 'lore' => $skin['lore'],
'availability' => $skin['availability'], 'availability' => $skin['availability'],
'loot_eligible' => $skin['lootEligible'], '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. // 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. // 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)) { 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); $skinExists->update($skinAttributes);
$changeCount++; $changeCount++;
} elseif (!$skinExists) { } elseif (! $skinExists) {
Log::info('New skin detected! Creating ' . $skin['name'] . ' ' . $champion['name'] . '...'); Log::info('New skin detected! Creating '.$skin['name'].' '.$champion['name'].'...');
ChampionSkin::create($skinAttributes); ChampionSkin::create($skinAttributes);
$changeCount++; $changeCount++;
} }

View File

@@ -4,8 +4,8 @@ namespace Database\Seeders;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents; // use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder; use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
class DatabaseSeeder extends Seeder class DatabaseSeeder extends Seeder
{ {
@@ -23,6 +23,6 @@ class DatabaseSeeder extends Seeder
Cache::flush(); 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 = [ $chromaAttributes = [
'chroma_id' => $chromaId, 'chroma_id' => $chromaId,
'full_skin_id' => $skin['id'], 'full_skin_id' => $skin['id'],
'skin_name' => $skin['name'] . ' ' . $champion['name'], 'skin_name' => $skin['name'].' '.$champion['name'],
'chroma_name' => $chroma['name'], 'chroma_name' => $chroma['name'],
'chroma_colors' => $chroma['colors'], 'chroma_colors' => $chroma['colors'],
'chroma_image' => $chroma['chromaPath'], 'chroma_image' => $chroma['chromaPath'],
@@ -50,11 +50,11 @@ class SkinChromaSeeder extends Seeder
} }
if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) { if ($chromaExists && $this->hasAttributesChanged($chromaExists, $chromaAttributes)) {
Log::info('Updating chroma: ' . $chromaId); Log::info('Updating chroma: '.$chromaId);
$chromaExists->update($chromaAttributes); $chromaExists->update($chromaAttributes);
$changeCount++; $changeCount++;
} elseif (!$chromaExists) { } elseif (! $chromaExists) {
Log::info('Creating chroma: ' . $chromaId); Log::info('Creating chroma: '.$chromaId);
SkinChroma::create($chromaAttributes); SkinChroma::create($chromaAttributes);
$changeCount++; $changeCount++;
} }

View File

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

View File

@@ -32,7 +32,7 @@ class SummonerIconSeeder extends Seeder
'description' => $icon['descriptions'][0]['description'] ?? null, 'description' => $icon['descriptions'][0]['description'] ?? null,
'release_year' => $icon['yearReleased'], 'release_year' => $icon['yearReleased'],
'legacy' => $icon['isLegacy'], '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_team' => $icon['esportsTeam'] ?? null,
'esports_region' => $icon['esportsRegion'] ?? null, 'esports_region' => $icon['esportsRegion'] ?? null,
'esports_event' => $icon['esportsEvent'] ?? 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. // 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. // 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)) { if ($iconExists && $this->hasAttributesChanged($iconExists, $iconAttributes)) {
Log::info('Icon ' . $iconId . ' has changed, updating...'); Log::info('Icon '.$iconId.' has changed, updating...');
$iconExists->update($iconAttributes); $iconExists->update($iconAttributes);
$changeCount++; $changeCount++;
} elseif (!$iconExists) { } elseif (! $iconExists) {
Log::info('New icon detected! Creating ' . $iconId . '...'); Log::info('New icon detected! Creating '.$iconId.'...');
SummonerIcon::create($iconAttributes); SummonerIcon::create($iconAttributes);
$changeCount++; $changeCount++;
} }

View File

@@ -5,13 +5,13 @@ use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true)); define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode... // 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; require $maintenance;
} }
// Register the Composer autoloader... // Register the Composer autoloader...
require __DIR__ . '/../vendor/autoload.php'; require __DIR__.'/../vendor/autoload.php';
// Bootstrap Laravel and handle the request... // Bootstrap Laravel and handle the request...
(require_once __DIR__ . '/../bootstrap/app.php') (require_once __DIR__.'/../bootstrap/app.php')
->handleRequest(Request::capture()); ->handleRequest(Request::capture());

View File

@@ -17,6 +17,6 @@ return static function (RectorConfig $rectorConfig): void {
SetList::DEAD_CODE, SetList::DEAD_CODE,
SetList::EARLY_RETURN, SetList::EARLY_RETURN,
SetList::STRICT_BOOLEANS, SetList::STRICT_BOOLEANS,
LevelSetList::UP_TO_PHP_82 LevelSetList::UP_TO_PHP_82,
]); ]);
}; };

View File

@@ -1,6 +1,5 @@
<?php <?php
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
| API Routes | API Routes

View File

@@ -13,7 +13,6 @@ use Illuminate\Support\Facades\Schedule;
| |
*/ */
Schedule::command('db:seed --force')->twiceDaily(1, 13)->timezone('Europe/Amsterdam'); Schedule::command('db:seed --force')->twiceDaily(1, 13)->timezone('Europe/Amsterdam');
Schedule::command('sitemap:generate')->weekly(); Schedule::command('sitemap:generate')->weekly();

View File

@@ -16,8 +16,8 @@ use App\Http\Requests\ContactSubmissionRequest;
use App\Models\Champion; use App\Models\Champion;
use App\Models\SummonerIcon; use App\Models\SummonerIcon;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Spatie\Sheets\Sheet;
use Spatie\Honeypot\ProtectAgainstSpam; use Spatie\Honeypot\ProtectAgainstSpam;
use Spatie\Sheets\Sheet;
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------