feat: refactor code and improve readability

This commit is contained in:
Rico van Zelst
2025-03-04 12:50:19 +01:00
parent efc263e257
commit 68d18311b4
8 changed files with 25 additions and 34 deletions

View File

@@ -24,7 +24,7 @@ function getAverageColorFromImageUrl($imageUrl): string
try {
$img = $imgManager->read(file_get_contents($imageUrl));
} catch (Exception $e) {
} catch (Exception) {
return '#904f2c';
}
@@ -90,9 +90,7 @@ function getChampionImage($full_id, $type): string
function getCommitHash(): string
{
/** @var string $commit */
$commit = Cache::remember('commit_hash', 60 * 72, function () {
return trim(exec('git log --pretty="%h" -n1 HEAD'));
});
$commit = Cache::remember('commit_hash', 60 * 72, fn() => trim(exec('git log --pretty="%h" -n1 HEAD')));
return $commit;
}