diff --git a/app/Console/Commands/Admin/MediaMoveStorageLocalToCloud.php b/app/Console/Commands/Admin/MediaMoveStorageLocalToCloud.php index 81e850ada..43e677b54 100644 --- a/app/Console/Commands/Admin/MediaMoveStorageLocalToCloud.php +++ b/app/Console/Commands/Admin/MediaMoveStorageLocalToCloud.php @@ -612,7 +612,7 @@ class MediaMoveStorageLocalToCloud extends Command try { return $cloudDisk->url($path); - } catch (\Throwable $e) { + } catch (\Throwable) { return $cloud.':'.$path; } } diff --git a/app/Console/Commands/Admin/MediaUpdateS3CDNUrl.php b/app/Console/Commands/Admin/MediaUpdateS3CDNUrl.php index 6e6409d7e..f5b3d94a5 100644 --- a/app/Console/Commands/Admin/MediaUpdateS3CDNUrl.php +++ b/app/Console/Commands/Admin/MediaUpdateS3CDNUrl.php @@ -347,7 +347,7 @@ class MediaUpdateS3CDNUrl extends Command { try { return (string) Storage::disk(config('filesystems.cloud'))->url($path); - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } @@ -359,7 +359,7 @@ class MediaUpdateS3CDNUrl extends Command $host = parse_url($url, PHP_URL_HOST); return $host ?: null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Console/Commands/Admin/SendUpdateActor.php b/app/Console/Commands/Admin/SendUpdateActor.php index 98981c0ea..4ea95964e 100644 --- a/app/Console/Commands/Admin/SendUpdateActor.php +++ b/app/Console/Commands/Admin/SendUpdateActor.php @@ -96,7 +96,7 @@ class SendUpdateActor extends Command $body = $this->updateObject($profile); try { Helpers::sendSignedObject($profile, $url, $body); - } catch (\Throwable $e) { + } catch (\Throwable) { // Best-effort per user: a single bad host (transport // failure, invalid destination, etc.) must not abort the // fleet-wide actor update. diff --git a/app/Console/Commands/Admin/Unstable/MediaMoveStorageCloudToCloud.php b/app/Console/Commands/Admin/Unstable/MediaMoveStorageCloudToCloud.php index cf7434c5d..83058b23e 100644 --- a/app/Console/Commands/Admin/Unstable/MediaMoveStorageCloudToCloud.php +++ b/app/Console/Commands/Admin/Unstable/MediaMoveStorageCloudToCloud.php @@ -260,7 +260,7 @@ class MediaMoveStorageCloudToCloud extends Command $host = parse_url($url, PHP_URL_HOST); return $host ?: null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Console/Commands/Concerns/ManagesMediaStorageEnv.php b/app/Console/Commands/Concerns/ManagesMediaStorageEnv.php index e3d85e786..a7c0b4fd7 100644 --- a/app/Console/Commands/Concerns/ManagesMediaStorageEnv.php +++ b/app/Console/Commands/Concerns/ManagesMediaStorageEnv.php @@ -75,7 +75,7 @@ trait ManagesMediaStorageEnv $host = parse_url($url, PHP_URL_HOST); return $host ?: null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Console/Commands/Dev/SeedFollows.php b/app/Console/Commands/Dev/SeedFollows.php index fcbba91e5..5b8b1735c 100644 --- a/app/Console/Commands/Dev/SeedFollows.php +++ b/app/Console/Commands/Dev/SeedFollows.php @@ -59,7 +59,7 @@ class SeedFollows extends Command if ($follow->wasRecentlyCreated == true) { FollowPipeline::dispatch($follow); } - } catch (Exception $e) { + } catch (Exception) { continue; } } diff --git a/app/Console/Commands/Status/StatusAvatar.php b/app/Console/Commands/Status/StatusAvatar.php index a39e6a1f1..06629a5fc 100644 --- a/app/Console/Commands/Status/StatusAvatar.php +++ b/app/Console/Commands/Status/StatusAvatar.php @@ -166,7 +166,7 @@ class StatusAvatar extends Command return Storage::disk('local')->exists('public/'.$mediaPath) || Storage::disk('local')->exists($mediaPath); - } catch (\Throwable $e) { + } catch (\Throwable) { return false; } } diff --git a/app/Console/Commands/Status/StatusEmoji.php b/app/Console/Commands/Status/StatusEmoji.php index 6677441ad..438392361 100644 --- a/app/Console/Commands/Status/StatusEmoji.php +++ b/app/Console/Commands/Status/StatusEmoji.php @@ -155,7 +155,7 @@ class StatusEmoji extends Command return Storage::disk('local')->exists('public/'.$mediaPath) || Storage::disk('local')->exists($mediaPath); - } catch (\Throwable $e) { + } catch (\Throwable) { return false; } } diff --git a/app/Console/Commands/Status/StatusMedia.php b/app/Console/Commands/Status/StatusMedia.php index 0b18b7457..4cc451bde 100644 --- a/app/Console/Commands/Status/StatusMedia.php +++ b/app/Console/Commands/Status/StatusMedia.php @@ -288,7 +288,7 @@ class StatusMedia extends Command return Storage::disk('local')->exists('public/'.$mediaPath) || Storage::disk('local')->exists($mediaPath); - } catch (\Throwable $e) { + } catch (\Throwable) { return false; } } @@ -301,7 +301,7 @@ class StatusMedia extends Command try { return (string) Storage::disk(config('filesystems.cloud'))->url($mediaPath); - } catch (\Throwable $e) { + } catch (\Throwable) { return '(cloud disk not resolvable in this environment)'; } } diff --git a/app/Console/Commands/Status/StatusProfile.php b/app/Console/Commands/Status/StatusProfile.php index 37140a458..ea3dd6c3b 100644 --- a/app/Console/Commands/Status/StatusProfile.php +++ b/app/Console/Commands/Status/StatusProfile.php @@ -311,7 +311,7 @@ class StatusProfile extends Command $avatar = $profile->avatar; return $avatar ? 'present (media_path='.($avatar->media_path ?? 'null').')' : 'MISSING'; - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } @@ -325,7 +325,7 @@ class StatusProfile extends Command { try { return (string) ($fn() ?? 'null'); - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } @@ -334,7 +334,7 @@ class StatusProfile extends Command { try { return (string) $fn(); - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } diff --git a/app/Console/Commands/Status/StatusStatuses.php b/app/Console/Commands/Status/StatusStatuses.php index 6ebfa9a34..3c3eb9d3b 100644 --- a/app/Console/Commands/Status/StatusStatuses.php +++ b/app/Console/Commands/Status/StatusStatuses.php @@ -270,7 +270,7 @@ class StatusStatuses extends Command try { return (string) Storage::disk(config('filesystems.cloud'))->url($mediaPath); - } catch (\Throwable $e) { + } catch (\Throwable) { return '(cloud disk not resolvable in this environment)'; } } @@ -285,7 +285,7 @@ class StatusStatuses extends Command $host = parse_url($url, PHP_URL_HOST); return $host ?: null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Console/Commands/Status/StatusUser.php b/app/Console/Commands/Status/StatusUser.php index 841d23ef5..7356c8faf 100644 --- a/app/Console/Commands/Status/StatusUser.php +++ b/app/Console/Commands/Status/StatusUser.php @@ -306,7 +306,7 @@ class StatusUser extends Command } return 'present (media_path='.($avatar->media_path ?? 'null').')'; - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } @@ -320,7 +320,7 @@ class StatusUser extends Command { try { return (string) ($fn() ?? 'null'); - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } @@ -425,7 +425,7 @@ class StatusUser extends Command } return (int) DB::table('oauth_access_tokens')->where('user_id', $user->id)->count(); - } catch (\Throwable $e) { + } catch (\Throwable) { return 0; } } @@ -434,7 +434,7 @@ class StatusUser extends Command { try { return (string) $fn(); - } catch (\Throwable $e) { + } catch (\Throwable) { return 'error'; } } diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 2473c03a0..34a596a2c 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -959,7 +959,7 @@ class ApiV1Controller extends Controller $status = $napi ? StatusService::get($row->id, false) : StatusService::getMastodon($row->id, false); - } catch (\Throwable $e) { + } catch (\Throwable) { continue; } @@ -982,7 +982,7 @@ class ApiV1Controller extends Controller $reblog = $napi ? StatusService::get($reblogId, false) : StatusService::getMastodon($reblogId, false); - } catch (\Throwable $e) { + } catch (\Throwable) { continue; } @@ -2850,7 +2850,7 @@ class ApiV1Controller extends Controller if (! $status || ! isset($status['account']) || ! isset($status['account']['id'])) { return false; } - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -2921,7 +2921,7 @@ class ApiV1Controller extends Controller if (! $status || ! isset($status['account']) || ! isset($status['account']['id'])) { return false; } - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -3191,7 +3191,7 @@ class ApiV1Controller extends Controller if (! $status || ! isset($status['account']) || ! isset($status['account']['id'])) { return false; } - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/app/Http/Controllers/AppRegisterController.php b/app/Http/Controllers/AppRegisterController.php index c5e87aadf..fb5b26c1a 100644 --- a/app/Http/Controllers/AppRegisterController.php +++ b/app/Http/Controllers/AppRegisterController.php @@ -111,7 +111,7 @@ class AppRegisterController extends Controller try { Mail::to($email)->send(new InAppRegisterEmailVerify($code)); - } catch (\Exception $e) { + } catch (\Exception) { DB::rollBack(); return $this->appRedirect($redirectUri, [ @@ -221,7 +221,7 @@ class AppRegisterController extends Controller try { Mail::to($email)->send(new InAppRegisterEmailVerify($code)); - } catch (\Exception $e) { + } catch (\Exception) { DB::rollBack(); return $this->appRedirect($redirectUri, [ @@ -327,7 +327,7 @@ class AppRegisterController extends Controller try { $tokens = $tokenFactory->issue($user, (string) $clientId, (string) $clientSecret, $scopes); - } catch (OAuthServerException $e) { + } catch (OAuthServerException) { return response()->json([ 'status' => 'error', 'code' => 'account_created_token_failed', diff --git a/app/Http/Controllers/OAuth/ApiTokenController.php b/app/Http/Controllers/OAuth/ApiTokenController.php index 7d72bace1..b47965895 100644 --- a/app/Http/Controllers/OAuth/ApiTokenController.php +++ b/app/Http/Controllers/OAuth/ApiTokenController.php @@ -43,7 +43,7 @@ class ApiTokenController extends AccessTokenController $payload = json_decode(base64_decode(strtr($parts[1], '-_', '+/')), true); return $payload['jti'] ?? null; - } catch (\Exception $e) { + } catch (\Exception) { return null; } } diff --git a/app/Http/Controllers/PersonalAccessTokenController.php b/app/Http/Controllers/PersonalAccessTokenController.php index 092cb036d..747c24ab1 100644 --- a/app/Http/Controllers/PersonalAccessTokenController.php +++ b/app/Http/Controllers/PersonalAccessTokenController.php @@ -79,7 +79,7 @@ class PersonalAccessTokenController extends Controller $validated['name'], $scopes ); - } catch (\RuntimeException $e) { + } catch (\RuntimeException) { return response()->json([ 'error' => 'Unable to create personal access token. The server may not have a personal access client configured. Please contact your administrator.', ], 500); diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php index 221fe2ddb..998833d6c 100644 --- a/app/Http/Controllers/PublicApiController.php +++ b/app/Http/Controllers/PublicApiController.php @@ -468,7 +468,7 @@ class PublicApiController extends Controller if (! $status) { return false; } - } catch (\Exception $e) { + } catch (\Exception) { return false; } $status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id); @@ -517,7 +517,7 @@ class PublicApiController extends Controller if (! $status) { return false; } - } catch (\Exception $e) { + } catch (\Exception) { return false; } $status['favourited'] = (bool) LikeService::liked($user->profile_id, $s->id); @@ -881,7 +881,7 @@ class PublicApiController extends Controller } return $mastodonStatus; - } catch (\Exception $e) { + } catch (\Exception) { return null; } }) diff --git a/app/Http/Controllers/RemoteAuthController.php b/app/Http/Controllers/RemoteAuthController.php index 3998afbe5..75f1f4893 100644 --- a/app/Http/Controllers/RemoteAuthController.php +++ b/app/Http/Controllers/RemoteAuthController.php @@ -566,9 +566,9 @@ class RemoteAuthController extends Controller } else { return []; } - } catch (RequestException $e) { + } catch (RequestException) { return []; - } catch (\Exception $e) { + } catch (\Exception) { return []; } } diff --git a/app/Jobs/GroupPipeline/LikePipeline.php b/app/Jobs/GroupPipeline/LikePipeline.php index 0fabee38a..50c08b8b6 100644 --- a/app/Jobs/GroupPipeline/LikePipeline.php +++ b/app/Jobs/GroupPipeline/LikePipeline.php @@ -80,7 +80,7 @@ class LikePipeline implements ShouldQueue try { NotificationService::createNotification($status->profile_id, $actor->id, 'group:like', $status->id, Status::class); - } catch (\Exception $e) { + } catch (\Exception) { } } diff --git a/app/Jobs/ImportPipeline/ImportInstagram.php b/app/Jobs/ImportPipeline/ImportInstagram.php index 119288829..ef5535e0d 100644 --- a/app/Jobs/ImportPipeline/ImportInstagram.php +++ b/app/Jobs/ImportPipeline/ImportInstagram.php @@ -87,7 +87,7 @@ class ImportInstagram implements ShouldQueue if (! $min->lt($taken_at)) { $taken_at = now(); } - } catch (\Exception $e) { + } catch (\Exception) { } $filename = last(explode('/', $import['path'])); diff --git a/app/Jobs/MovePipeline/MoveSendUndoFollowPipeline.php b/app/Jobs/MovePipeline/MoveSendUndoFollowPipeline.php index c4fd8e66c..daa437798 100644 --- a/app/Jobs/MovePipeline/MoveSendUndoFollowPipeline.php +++ b/app/Jobs/MovePipeline/MoveSendUndoFollowPipeline.php @@ -134,7 +134,7 @@ class MoveSendUndoFollowPipeline implements ShouldQueue ->timeout(config('federation.activitypub.delivery.timeout')) ->withBody($payload, 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"') ->post($targetInbox); - } catch (ConnectionException $e) { + } catch (ConnectionException) { } } diff --git a/app/Jobs/VideoPipeline/VideoThumbnailToCloudPipeline.php b/app/Jobs/VideoPipeline/VideoThumbnailToCloudPipeline.php index eea4be8ae..9a2252741 100644 --- a/app/Jobs/VideoPipeline/VideoThumbnailToCloudPipeline.php +++ b/app/Jobs/VideoPipeline/VideoThumbnailToCloudPipeline.php @@ -134,7 +134,7 @@ class VideoThumbnailToCloudPipeline implements ShouldBeUniqueUntilProcessing, Sh if (str_starts_with($media->media_path, 'public/m/_v2/') && str_ends_with($media->media_path, '.mp4')) { Storage::disk('local')->delete($media->media_path); } - } catch (\Exception $e) { + } catch (\Exception) { } if ($media->status_id) { diff --git a/app/Services/Account/RemoteAuthService.php b/app/Services/Account/RemoteAuthService.php index 9ada50709..d05925a86 100644 --- a/app/Services/Account/RemoteAuthService.php +++ b/app/Services/Account/RemoteAuthService.php @@ -38,11 +38,11 @@ class RemoteAuthService if (! $res->ok()) { return false; } - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -81,11 +81,11 @@ class RemoteAuthService 'redirect_uri' => $raw->redirect_uri, 'scope' => 'read', ]); - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -106,11 +106,11 @@ class RemoteAuthService if (! $res->ok()) { return false; } - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -133,11 +133,11 @@ class RemoteAuthService if (! $res->ok()) { return false; } - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } @@ -168,11 +168,11 @@ class RemoteAuthService } return $json['compatible']; - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } }); @@ -185,11 +185,11 @@ class RemoteAuthService if (! $res->ok()) { return false; } - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } $json = $res->json(); @@ -214,11 +214,11 @@ class RemoteAuthService if (! $res->ok()) { return; } - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return; - } catch (\Exception $e) { + } catch (\Exception) { return; } diff --git a/app/Services/ActivityPubFetchService.php b/app/Services/ActivityPubFetchService.php index 49b6e5b19..fad02f379 100644 --- a/app/Services/ActivityPubFetchService.php +++ b/app/Services/ActivityPubFetchService.php @@ -167,7 +167,7 @@ class ActivityPubFetchService 64, JSON_THROW_ON_ERROR ); - } catch (\JsonException $e) { + } catch (\JsonException) { return; } } @@ -234,7 +234,7 @@ class ActivityPubFetchService return Helpers::validateUrl($url) ? $url : null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Services/AvatarService.php b/app/Services/AvatarService.php index f070dc68c..4bbb88360 100644 --- a/app/Services/AvatarService.php +++ b/app/Services/AvatarService.php @@ -96,7 +96,7 @@ class AvatarService } catch ( UnableToRetrieveMetadata| UnableToCheckDirectoryExistence| - Exception $e + Exception ) { return; } diff --git a/app/Services/ConfigCacheService.php b/app/Services/ConfigCacheService.php index 9402f44a8..7744709a2 100644 --- a/app/Services/ConfigCacheService.php +++ b/app/Services/ConfigCacheService.php @@ -190,7 +190,7 @@ class ConfigCacheService return $v; }); - } catch (Exception|QueryException $e) { + } catch (Exception|QueryException) { return config($key); } } diff --git a/app/Services/CustomEmojiService.php b/app/Services/CustomEmojiService.php index 4480c2b05..8a461c56b 100644 --- a/app/Services/CustomEmojiService.php +++ b/app/Services/CustomEmojiService.php @@ -77,9 +77,9 @@ class CustomEmojiService ->timeout(15) ->connectTimeout(5) ->get($url); - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (\Exception $e) { + } catch (\Exception) { return; } @@ -140,7 +140,7 @@ class CustomEmojiService $emoji->media_path = $mediaPath; $emoji->save(); - } catch (\Exception $e) { + } catch (\Exception) { // Download failed return; } @@ -231,7 +231,7 @@ class CustomEmojiService $emoji->media_path = $mediaPath; $emoji->save(); } - } catch (\Throwable $e) { + } catch (\Throwable) { return 'failed'; } diff --git a/app/Services/FetchCacheService.php b/app/Services/FetchCacheService.php index 85236a20e..f9ac181c4 100644 --- a/app/Services/FetchCacheService.php +++ b/app/Services/FetchCacheService.php @@ -72,15 +72,15 @@ class FetchCacheService ->withHeaders($headers) ->timeout(40) ->get($url); - } catch (RequestException $e) { + } catch (RequestException) { Cache::put($key, 1, $ttl); return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { Cache::put($key, 1, $ttl); return false; - } catch (\Exception $e) { + } catch (\Exception) { Cache::put($key, 1, $ttl); return false; diff --git a/app/Services/FilesystemService.php b/app/Services/FilesystemService.php index 703d72145..e7b03926d 100644 --- a/app/Services/FilesystemService.php +++ b/app/Services/FilesystemService.php @@ -55,14 +55,14 @@ class FilesystemService } else { $writable = false; } - } catch (FilesystemException|UnableToReadFile $exception) { + } catch (FilesystemException|UnableToReadFile) { $writable = false; } if (in_array(self::VERIFY_FILE_NAME, $res)) { try { $filesystem->delete(self::VERIFY_FILE_NAME); - } catch (FilesystemException|UnableToDeleteFile $exception) { + } catch (FilesystemException|UnableToDeleteFile) { $writable = false; } } diff --git a/app/Services/ImportService.php b/app/Services/ImportService.php index 5b6328ba2..e63ed9a64 100644 --- a/app/Services/ImportService.php +++ b/app/Services/ImportService.php @@ -314,7 +314,7 @@ class ImportService $nextDay->month, $nextDay->day, ]; - } catch (\Exception $e) { + } catch (\Exception) { return [null, null, null]; } } diff --git a/app/Services/Internal/BeagleService.php b/app/Services/Internal/BeagleService.php index a3e4215da..14cbc76f3 100644 --- a/app/Services/Internal/BeagleService.php +++ b/app/Services/Internal/BeagleService.php @@ -28,11 +28,11 @@ class BeagleService ->connectTimeout(5) ->retry(2, 500) ->get('https://beagle.pixelfed.net/api/v1/common/suggestions/rules'); - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return; - } catch (\Exception $e) { + } catch (\Exception) { return; } @@ -69,11 +69,11 @@ class BeagleService ->connectTimeout(5) ->retry(2, 500) ->get('https://beagle.pixelfed.net/api/v1/discover'); - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return; - } catch (\Exception $e) { + } catch (\Exception) { return; } diff --git a/app/Services/Internal/SoftwareUpdateService.php b/app/Services/Internal/SoftwareUpdateService.php index 741ad7dbd..0d9c4fa45 100644 --- a/app/Services/Internal/SoftwareUpdateService.php +++ b/app/Services/Internal/SoftwareUpdateService.php @@ -79,11 +79,11 @@ class SoftwareUpdateService ->connectTimeout(5) ->retry(2, 500) ->get('https://versions.pixelfed.org/versions.json'); - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return; - } catch (\Exception $e) { + } catch (\Exception) { return; } diff --git a/app/Services/NodeinfoService.php b/app/Services/NodeinfoService.php index 056725357..1ebf1db35 100644 --- a/app/Services/NodeinfoService.php +++ b/app/Services/NodeinfoService.php @@ -77,11 +77,11 @@ class NodeinfoService ->withHeaders($headers) ->timeout(5) ->get($href); - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Exception $e) { + } catch (\Exception) { return false; } diff --git a/app/Services/NotificationAppGatewayService.php b/app/Services/NotificationAppGatewayService.php index 74722c84c..2ad798bc6 100644 --- a/app/Services/NotificationAppGatewayService.php +++ b/app/Services/NotificationAppGatewayService.php @@ -44,9 +44,9 @@ class NotificationAppGatewayService ->get($endpoint); $data = $res->json(); - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (Exception $e) { + } catch (Exception) { return false; } @@ -120,9 +120,9 @@ class NotificationAppGatewayService ]); $response->throw(); - } catch (RequestException $e) { + } catch (RequestException) { return; - } catch (Exception $e) { + } catch (Exception) { return; } } diff --git a/app/Services/SearchApiV2Service.php b/app/Services/SearchApiV2Service.php index b6b32fa5c..d5668546a 100644 --- a/app/Services/SearchApiV2Service.php +++ b/app/Services/SearchApiV2Service.php @@ -248,7 +248,7 @@ class SearchApiV2Service ) { try { $res = WebfingerService::lookup('@'.$query, $mastodonMode); - } catch (\Exception $e) { + } catch (\Exception) { return $default; } if ($res && isset($res['id'], $res['url'])) { @@ -272,7 +272,7 @@ class SearchApiV2Service if (Str::substrCount($query, '@') == 2) { try { $res = WebfingerService::lookup($query, $mastodonMode); - } catch (\Exception $e) { + } catch (\Exception) { return $default; } if ($res && isset($res['id'])) { @@ -360,7 +360,7 @@ class SearchApiV2Service ]; } } - } catch (\Exception $e) { + } catch (\Exception) { return [ 'accounts' => [], 'hashtags' => [], diff --git a/app/Services/SecureMediaFetchService.php b/app/Services/SecureMediaFetchService.php index 6e1f76b1c..17be3df98 100644 --- a/app/Services/SecureMediaFetchService.php +++ b/app/Services/SecureMediaFetchService.php @@ -134,11 +134,11 @@ class SecureMediaFetchService ->timeout(self::TIMEOUT) ->connectTimeout(self::CONNECT_TIMEOUT) ->{$method}($currentUrl); - } catch (RequestException $e) { + } catch (RequestException) { return false; - } catch (ConnectionException $e) { + } catch (ConnectionException) { return false; - } catch (\Throwable $e) { + } catch (\Throwable) { return false; } @@ -227,7 +227,7 @@ class SecureMediaFetchService $resolved = (string) BaseUri::from($baseUrl)->resolve($location); return Helpers::validateUrl($resolved) ? $resolved : null; - } catch (\Throwable $e) { + } catch (\Throwable) { return null; } } diff --git a/app/Util/ActivityPub/Helpers.php b/app/Util/ActivityPub/Helpers.php index 80cbd925c..4193d3295 100644 --- a/app/Util/ActivityPub/Helpers.php +++ b/app/Util/ActivityPub/Helpers.php @@ -204,7 +204,7 @@ class Helpers try { $uri = $uri->withHost($host); - } catch (\Throwable $e) { + } catch (\Throwable) { return false; } @@ -575,7 +575,7 @@ class Helpers $isMoreThanOneDayFuture = $date->gt($tomorrow); return ! ($isMoreThanTenYearsOld || $isMoreThanOneDayFuture); - } catch (\Exception $e) { + } catch (\Exception) { return false; } } @@ -1251,7 +1251,7 @@ class Helpers try { $mediaModel->save(); - } catch (UniqueConstraintViolationException $e) { + } catch (UniqueConstraintViolationException) { // Lost a race with a concurrent inbox job that inserted the same // (status_id, media_path). Treat as already-imported. return null;