mirror of
https://github.com/rico-vz/HeimerdingerLoL.git
synced 2025-12-06 10:10:48 +01:00
Merge pull request #89 from rico-vz/analysis-Koy6ER
Apply fixes from StyleCI
This commit is contained in:
@@ -17,9 +17,9 @@ class ChampionController extends Controller
|
|||||||
{
|
{
|
||||||
$eightHoursInSeconds = 60 * 60 * 8;
|
$eightHoursInSeconds = 60 * 60 * 8;
|
||||||
|
|
||||||
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn() => Champion::orderBy('name')->get());
|
$champions = Cache::remember('championsListAllCache', $eightHoursInSeconds, static fn () => Champion::orderBy('name')->get());
|
||||||
|
|
||||||
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn() => ChampionRoles::orderBy('champion_name')->get());
|
$roles = Cache::remember('championsRolesCache', $eightHoursInSeconds, static fn () => ChampionRoles::orderBy('champion_name')->get());
|
||||||
|
|
||||||
return view('champions.index', ['champions' => $champions, 'roles' => $roles]);
|
return view('champions.index', ['champions' => $champions, 'roles' => $roles]);
|
||||||
}
|
}
|
||||||
@@ -48,12 +48,12 @@ 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())
|
||||||
);
|
);
|
||||||
|
|
||||||
$champion->splash_color = $splashColor;
|
$champion->splash_color = $splashColor;
|
||||||
|
|||||||
@@ -57,13 +57,13 @@ class ChampionSkinController extends Controller
|
|||||||
$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())
|
||||||
);
|
);
|
||||||
|
|
||||||
$skin->splash_color = $splashColor;
|
$skin->splash_color = $splashColor;
|
||||||
|
|||||||
Reference in New Issue
Block a user