@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | if ($outputJson) { |
| 61 | - $this->line(json_encode($details, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); |
|
| 61 | + $this->line(json_encode($details, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES)); |
|
| 62 | 62 | } else { |
| 63 | 63 | $this->displayGameDetails($details); |
| 64 | 64 | } |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | if ($playerCount !== null) { |
| 85 | - $this->info("Current Players: " . number_format($playerCount)); |
|
| 85 | + $this->info("Current Players: ".number_format($playerCount)); |
|
| 86 | 86 | } |
| 87 | 87 | } |
| 88 | 88 | |
@@ -166,7 +166,7 @@ discard block |
||
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | if (!empty($details['recommendations'])) { |
| 169 | - $this->line("Recommendations: " . number_format($details['recommendations'])); |
|
| 169 | + $this->line("Recommendations: ".number_format($details['recommendations'])); |
|
| 170 | 170 | } |
| 171 | 171 | } |
| 172 | 172 | |
@@ -53,8 +53,8 @@ |
||
| 53 | 53 | $tableData = $results->map(fn($r) => [ |
| 54 | 54 | $r['appid'], |
| 55 | 55 | substr($r['name'], 0, 60), |
| 56 | - number_format($r['score'], 1) . '%', |
|
| 57 | - 'https://store.steampowered.com/app/' . $r['appid'], |
|
| 56 | + number_format($r['score'], 1).'%', |
|
| 57 | + 'https://store.steampowered.com/app/'.$r['appid'], |
|
| 58 | 58 | ])->toArray(); |
| 59 | 59 | |
| 60 | 60 | table( |
@@ -86,14 +86,14 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | // Check failed lookup cache |
| 89 | - $cacheKey = 'steam_search_failed:' . md5(mb_strtolower($cleanTitle)); |
|
| 89 | + $cacheKey = 'steam_search_failed:'.md5(mb_strtolower($cleanTitle)); |
|
| 90 | 90 | if (Cache::has($cacheKey)) { |
| 91 | 91 | Log::debug('SteamService: Skipping previously failed search', ['title' => $cleanTitle]); |
| 92 | 92 | return null; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | // Check successful search cache |
| 96 | - $successCacheKey = 'steam_search:' . md5(mb_strtolower($cleanTitle)); |
|
| 96 | + $successCacheKey = 'steam_search:'.md5(mb_strtolower($cleanTitle)); |
|
| 97 | 97 | $cached = Cache::get($successCacheKey); |
| 98 | 98 | if ($cached !== null) { |
| 99 | 99 | Log::debug('SteamService: Using cached search result', ['title' => $cleanTitle, 'appid' => $cached]); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | |
| 196 | 196 | try { |
| 197 | 197 | $response = $this->makeRequest( |
| 198 | - self::STEAM_API_BASE . '/ISteamUserStats/GetNumberOfCurrentPlayers/v1/', |
|
| 198 | + self::STEAM_API_BASE.'/ISteamUserStats/GetNumberOfCurrentPlayers/v1/', |
|
| 199 | 199 | ['appid' => $appId] |
| 200 | 200 | ); |
| 201 | 201 | |
@@ -227,7 +227,7 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | try { |
| 229 | 229 | $response = Http::timeout(10) |
| 230 | - ->get(self::STEAM_STORE_BASE . '/appreviews/' . $appId, [ |
|
| 230 | + ->get(self::STEAM_STORE_BASE.'/appreviews/'.$appId, [ |
|
| 231 | 231 | 'json' => 1, |
| 232 | 232 | 'language' => 'all', |
| 233 | 233 | 'purchase_type' => 'all', |
@@ -379,7 +379,7 @@ discard block |
||
| 379 | 379 | |
| 380 | 380 | try { |
| 381 | 381 | $response = Http::timeout(60) |
| 382 | - ->get(self::STEAM_API_BASE . '/ISteamApps/GetAppList/v2/') |
|
| 382 | + ->get(self::STEAM_API_BASE.'/ISteamApps/GetAppList/v2/') |
|
| 383 | 383 | ->json(); |
| 384 | 384 | |
| 385 | 385 | if ($response && isset($response['applist']['apps'])) { |
@@ -532,10 +532,10 @@ discard block |
||
| 532 | 532 | return RateLimiter::attempt( |
| 533 | 533 | self::RATE_LIMIT_KEY, |
| 534 | 534 | self::REQUESTS_PER_MINUTE, |
| 535 | - function () use ($appId) { |
|
| 535 | + function() use ($appId) { |
|
| 536 | 536 | try { |
| 537 | 537 | $response = Http::timeout(15) |
| 538 | - ->get(self::STEAM_STORE_BASE . '/appdetails', [ |
|
| 538 | + ->get(self::STEAM_STORE_BASE.'/appdetails', [ |
|
| 539 | 539 | 'appids' => $appId, |
| 540 | 540 | 'cc' => 'us', |
| 541 | 541 | 'l' => 'english', |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | 'website' => $data['website'] ?? null, |
| 718 | 718 | 'support_url' => $data['support_info']['url'] ?? null, |
| 719 | 719 | 'legal_notice' => $data['legal_notice'] ?? null, |
| 720 | - 'directurl' => self::STEAM_STORE_URL . $appId, |
|
| 720 | + 'directurl' => self::STEAM_STORE_URL.$appId, |
|
| 721 | 721 | ]; |
| 722 | 722 | } |
| 723 | 723 | |
@@ -738,7 +738,7 @@ discard block |
||
| 738 | 738 | return RateLimiter::attempt( |
| 739 | 739 | self::RATE_LIMIT_KEY, |
| 740 | 740 | self::REQUESTS_PER_MINUTE, |
| 741 | - function () use ($url, $params) { |
|
| 741 | + function() use ($url, $params) { |
|
| 742 | 742 | if ($this->apiKey !== null) { |
| 743 | 743 | $params['key'] = $this->apiKey; |
| 744 | 744 | } |
@@ -781,7 +781,7 @@ discard block |
||
| 781 | 781 | $title = (string) preg_replace('/\[[^\]]*\]|\([^)]*\)|\{[^}]*\}/u', ' ', $title); |
| 782 | 782 | |
| 783 | 783 | // Remove scene groups at end |
| 784 | - $groupPattern = '/\s*[-_]\s*(' . implode('|', array_map('preg_quote', self::SCENE_GROUPS)) . ')\s*$/i'; |
|
| 784 | + $groupPattern = '/\s*[-_]\s*('.implode('|', array_map('preg_quote', self::SCENE_GROUPS)).')\s*$/i'; |
|
| 785 | 785 | $title = (string) preg_replace($groupPattern, '', $title); |
| 786 | 786 | |
| 787 | 787 | // Remove edition tags (multi-word patterns first) |
@@ -802,12 +802,12 @@ discard block |
||
| 802 | 802 | if (stripos($tag, 'EDITION') !== false) { |
| 803 | 803 | continue; |
| 804 | 804 | } |
| 805 | - $title = (string) preg_replace('/\b' . preg_quote($tag, '/') . '\b/i', ' ', $title); |
|
| 805 | + $title = (string) preg_replace('/\b'.preg_quote($tag, '/').'\b/i', ' ', $title); |
|
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | // Remove release tags |
| 809 | 809 | foreach (self::RELEASE_TAGS as $tag) { |
| 810 | - $title = (string) preg_replace('/\b' . preg_quote($tag, '/') . '\d*\b/i', ' ', $title); |
|
| 810 | + $title = (string) preg_replace('/\b'.preg_quote($tag, '/').'\d*\b/i', ' ', $title); |
|
| 811 | 811 | } |
| 812 | 812 | |
| 813 | 813 | // Remove DLCs tag (common in scene releases) |
@@ -900,7 +900,7 @@ discard block |
||
| 900 | 900 | array_map('strtolower', self::RELEASE_TAGS), |
| 901 | 901 | ['pc', 'win', 'windows', 'x86', 'x64', 'x32'] |
| 902 | 902 | ); |
| 903 | - $noisePattern = '/\b(' . implode('|', array_map(fn($w) => preg_quote($w, '/'), $noise)) . ')\b/u'; |
|
| 903 | + $noisePattern = '/\b('.implode('|', array_map(fn($w) => preg_quote($w, '/'), $noise)).')\b/u'; |
|
| 904 | 904 | $s = (string) preg_replace($noisePattern, ' ', $s); |
| 905 | 905 | |
| 906 | 906 | // Remove non-alphanumeric |
@@ -933,7 +933,7 @@ discard block |
||
| 933 | 933 | |
| 934 | 934 | // Remove remaining individual edition tags |
| 935 | 935 | foreach (self::EDITION_TAGS as $tag) { |
| 936 | - $title = (string) preg_replace('/\s*[-_]?\s*' . preg_quote($tag, '/') . '\s*/i', ' ', $title); |
|
| 936 | + $title = (string) preg_replace('/\s*[-_]?\s*'.preg_quote($tag, '/').'\s*/i', ' ', $title); |
|
| 937 | 937 | } |
| 938 | 938 | return trim(preg_replace('/\s+/', ' ', $title) ?? ''); |
| 939 | 939 | } |
@@ -1026,7 +1026,7 @@ discard block |
||
| 1026 | 1026 | |
| 1027 | 1027 | // Don't replace standalone 'i' as it's too common in titles |
| 1028 | 1028 | foreach ($map as $roman => $arabic) { |
| 1029 | - $s = (string) preg_replace('/\b' . $roman . '\b/ui', $arabic, $s); |
|
| 1029 | + $s = (string) preg_replace('/\b'.$roman.'\b/ui', $arabic, $s); |
|
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | return $s; |
@@ -1041,7 +1041,7 @@ discard block |
||
| 1041 | 1041 | $pattern = preg_replace('/\s+/', '%', $normalized); |
| 1042 | 1042 | $pattern = trim($pattern ?? ''); |
| 1043 | 1043 | |
| 1044 | - return $pattern === '' ? '%' : '%' . $pattern . '%'; |
|
| 1044 | + return $pattern === '' ? '%' : '%'.$pattern.'%'; |
|
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | /** |
@@ -220,7 +220,7 @@ |
||
| 220 | 220 | recommendationCount: $data['recommendations']['total'] ?? null, |
| 221 | 221 | website: $data['website'] ?? null, |
| 222 | 222 | supportUrl: $data['support_info']['url'] ?? null, |
| 223 | - storeUrl: 'https://store.steampowered.com/app/' . $appId, |
|
| 223 | + storeUrl: 'https://store.steampowered.com/app/'.$appId, |
|
| 224 | 224 | ); |
| 225 | 225 | } |
| 226 | 226 | |
@@ -23,11 +23,11 @@ |
||
| 23 | 23 | public static function fromApiResponse(array $data): self |
| 24 | 24 | { |
| 25 | 25 | return new self( |
| 26 | - currency: $data['currency'] ?? 'USD', |
|
| 27 | - initial: ($data['initial'] ?? 0) / 100, |
|
| 28 | - final: ($data['final'] ?? 0) / 100, |
|
| 29 | - discountPercent: $data['discount_percent'] ?? 0, |
|
| 30 | - formattedPrice: $data['final_formatted'] ?? null, |
|
| 26 | + currency : $data['currency'] ?? 'USD', |
|
| 27 | + initial : ($data['initial'] ?? 0) / 100, |
|
| 28 | + final : ($data['final'] ?? 0) / 100, |
|
| 29 | + discountPercent : $data['discount_percent'] ?? 0, |
|
| 30 | + formattedPrice : $data['final_formatted'] ?? null, |
|
| 31 | 31 | ); |
| 32 | 32 | } |
| 33 | 33 | |