MultiExceptionCatchRector

pull/7361/head
Your Name 5 days ago
parent 8dcdd93e2b
commit ca5d9f3db5

@ -566,9 +566,7 @@ class RemoteAuthController extends Controller
} else {
return [];
}
} catch (RequestException) {
return [];
} catch (\Exception) {
} catch (RequestException|\Exception) {
return [];
}
}

@ -38,11 +38,7 @@ class RemoteAuthService
if (! $res->ok()) {
return false;
}
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
@ -81,11 +77,7 @@ class RemoteAuthService
'redirect_uri' => $raw->redirect_uri,
'scope' => 'read',
]);
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
@ -106,11 +98,7 @@ class RemoteAuthService
if (! $res->ok()) {
return false;
}
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
@ -133,11 +121,7 @@ class RemoteAuthService
if (! $res->ok()) {
return false;
}
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
@ -168,11 +152,7 @@ class RemoteAuthService
}
return $json['compatible'];
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
});
@ -185,11 +165,7 @@ class RemoteAuthService
if (! $res->ok()) {
return false;
}
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}
$json = $res->json();
@ -214,11 +190,7 @@ class RemoteAuthService
if (! $res->ok()) {
return;
}
} catch (RequestException) {
return;
} catch (ConnectionException) {
return;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return;
}

@ -109,11 +109,7 @@ class ActivityPubFetchService
->connectTimeout(5)
->retry(2, 250)
->get($currentUrl);
} catch (RequestException $e) {
return;
} catch (ConnectionException $e) {
return;
} catch (\Throwable $e) {
} catch (RequestException|ConnectionException|\Throwable $e) {
return;
}

@ -77,9 +77,7 @@ class CustomEmojiService
->timeout(15)
->connectTimeout(5)
->get($url);
} catch (RequestException) {
return;
} catch (\Exception) {
} catch (RequestException|\Exception) {
return;
}

@ -72,15 +72,7 @@ class FetchCacheService
->withHeaders($headers)
->timeout(40)
->get($url);
} catch (RequestException) {
Cache::put($key, 1, $ttl);
return false;
} catch (ConnectionException) {
Cache::put($key, 1, $ttl);
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
Cache::put($key, 1, $ttl);
return false;

@ -28,11 +28,7 @@ class BeagleService
->connectTimeout(5)
->retry(2, 500)
->get('https://beagle.pixelfed.net/api/v1/common/suggestions/rules');
} catch (RequestException) {
return;
} catch (ConnectionException) {
return;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return;
}
@ -69,11 +65,7 @@ class BeagleService
->connectTimeout(5)
->retry(2, 500)
->get('https://beagle.pixelfed.net/api/v1/discover');
} catch (RequestException) {
return;
} catch (ConnectionException) {
return;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return;
}

@ -79,11 +79,7 @@ class SoftwareUpdateService
->connectTimeout(5)
->retry(2, 500)
->get('https://versions.pixelfed.org/versions.json');
} catch (RequestException) {
return;
} catch (ConnectionException) {
return;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return;
}

@ -28,11 +28,7 @@ class NodeinfoService
->withHeaders($headers)
->timeout(5)
->get($wk);
} catch (RequestException $e) {
return false;
} catch (ConnectionException $e) {
return false;
} catch (\Exception $e) {
} catch (RequestException|ConnectionException|\Exception $e) {
return false;
}
@ -77,11 +73,7 @@ class NodeinfoService
->withHeaders($headers)
->timeout(5)
->get($href);
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Exception) {
} catch (RequestException|ConnectionException|\Exception) {
return false;
}

@ -44,9 +44,7 @@ class NotificationAppGatewayService
->get($endpoint);
$data = $res->json();
} catch (RequestException) {
return false;
} catch (Exception) {
} catch (RequestException|Exception) {
return false;
}
@ -120,9 +118,7 @@ class NotificationAppGatewayService
]);
$response->throw();
} catch (RequestException) {
return;
} catch (Exception) {
} catch (RequestException|Exception) {
return;
}
}

@ -134,11 +134,7 @@ class SecureMediaFetchService
->timeout(self::TIMEOUT)
->connectTimeout(self::CONNECT_TIMEOUT)
->{$method}($currentUrl);
} catch (RequestException) {
return false;
} catch (ConnectionException) {
return false;
} catch (\Throwable) {
} catch (RequestException|ConnectionException|\Throwable) {
return false;
}

Loading…
Cancel
Save