mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 18:20:48 +01:00
Apply fixes from StyleCI
This commit is contained in:
@@ -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' => [
|
||||
|
||||
@@ -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.');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Intervention\Image\ImageManager;
|
||||
use Intervention\Image\Drivers\Gd\Driver;
|
||||
use Intervention\Image\ImageManager;
|
||||
|
||||
function getRoleIcon($roleName): string
|
||||
{
|
||||
@@ -13,7 +13,7 @@ function getRoleIcon($roleName): string
|
||||
'Support' => '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
|
||||
|
||||
@@ -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())
|
||||
);
|
||||
|
||||
@@ -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())
|
||||
);
|
||||
|
||||
@@ -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!');
|
||||
|
||||
@@ -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'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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'] ?? [];
|
||||
});
|
||||
|
||||
|
||||
@@ -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',
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,6 +41,7 @@ class SummonerIcon extends Model
|
||||
public function getSqidAttribute(): string
|
||||
{
|
||||
$sqids = new Sqids(minLength: 5);
|
||||
|
||||
return $sqids->encode([$this->icon_id]);
|
||||
}
|
||||
|
||||
|
||||
@@ -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')
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user