diff --git a/app/Bots/CasinoBot.php b/app/Bots/CasinoBot.php index bb733465b..0a958360d 100644 --- a/app/Bots/CasinoBot.php +++ b/app/Bots/CasinoBot.php @@ -23,6 +23,7 @@ use App\Models\UserAudible; use App\Models\UserEcho; use App\Repositories\ChatRepository; use Illuminate\Support\Carbon; +use Exception; class CasinoBot { @@ -78,7 +79,7 @@ class CasinoBot * Send Bot Donation. * * - * @throws \Exception + * @throws Exception */ public function putDonate(int $amount = 0, string $note = ''): string { @@ -118,7 +119,7 @@ class CasinoBot * Get Bot Donations. * * - * @throws \Exception + * @throws Exception */ public function getDonations(string $duration = 'default'): string { @@ -149,7 +150,7 @@ class CasinoBot /** * Process Message. * - * @throws \Exception + * @throws Exception */ public function process($type, User $user, string $message = '', int $targeted = 0): \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response|bool { diff --git a/app/Bots/NerdBot.php b/app/Bots/NerdBot.php index 68d2f8169..65f28126b 100644 --- a/app/Bots/NerdBot.php +++ b/app/Bots/NerdBot.php @@ -27,6 +27,7 @@ use App\Models\UserEcho; use App\Models\Warning; use App\Repositories\ChatRepository; use Illuminate\Support\Carbon; +use Exception; class NerdBot { @@ -325,7 +326,7 @@ class NerdBot /** * Send Bot Donation. * - * @throws \Exception + * @throws Exception */ public function putDonate($amount = 0, $note = '') { diff --git a/app/Console/Commands/AutoBanDisposableUsers.php b/app/Console/Commands/AutoBanDisposableUsers.php index 590cf134f..091ecf986 100644 --- a/app/Console/Commands/AutoBanDisposableUsers.php +++ b/app/Console/Commands/AutoBanDisposableUsers.php @@ -21,6 +21,7 @@ use App\Models\User; use App\Rules\EmailBlacklist; use Illuminate\Console\Command; use Illuminate\Support\Facades\Mail; +use Exception; /** * @see \Tests\Todo\Unit\Console\Commands\AutoBanDisposableUsersTest @@ -44,7 +45,7 @@ class AutoBanDisposableUsers extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoCorrectHistory.php b/app/Console/Commands/AutoCorrectHistory.php index 418766ef3..6747bd4b7 100644 --- a/app/Console/Commands/AutoCorrectHistory.php +++ b/app/Console/Commands/AutoCorrectHistory.php @@ -16,6 +16,7 @@ namespace App\Console\Commands; use App\Models\History; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoCorrectHistoryTest @@ -39,7 +40,7 @@ class AutoCorrectHistory extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoDisableInactiveUsers.php b/app/Console/Commands/AutoDisableInactiveUsers.php index 9efafab89..1d0b8d789 100644 --- a/app/Console/Commands/AutoDisableInactiveUsers.php +++ b/app/Console/Commands/AutoDisableInactiveUsers.php @@ -18,6 +18,7 @@ use App\Models\Group; use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoDisableInactiveUsersTest @@ -41,7 +42,7 @@ class AutoDisableInactiveUsers extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoFlushPeers.php b/app/Console/Commands/AutoFlushPeers.php index f841bf7b9..9f8c4ec8d 100644 --- a/app/Console/Commands/AutoFlushPeers.php +++ b/app/Console/Commands/AutoFlushPeers.php @@ -17,6 +17,7 @@ use App\Models\History; use App\Models\Peer; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoFlushPeersTest @@ -40,7 +41,7 @@ class AutoFlushPeers extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoNerdStat.php b/app/Console/Commands/AutoNerdStat.php index 4e0da310d..7829257c5 100644 --- a/app/Console/Commands/AutoNerdStat.php +++ b/app/Console/Commands/AutoNerdStat.php @@ -21,6 +21,7 @@ use App\Models\Warning; use App\Repositories\ChatRepository; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Todo\Unit\Console\Commands\AutoNerdStatTest @@ -52,7 +53,7 @@ class AutoNerdStat extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoPreWarning.php b/app/Console/Commands/AutoPreWarning.php index e059a08d8..71c2357b5 100644 --- a/app/Console/Commands/AutoPreWarning.php +++ b/app/Console/Commands/AutoPreWarning.php @@ -18,6 +18,7 @@ use App\Models\Warning; use App\Notifications\UserPreWarning; use Carbon\Carbon; use Illuminate\Console\Command; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoPreWarningTest @@ -41,7 +42,7 @@ class AutoPreWarning extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoRecycleClaimedTorrentRequests.php b/app/Console/Commands/AutoRecycleClaimedTorrentRequests.php index 10c88e2df..6766b7630 100644 --- a/app/Console/Commands/AutoRecycleClaimedTorrentRequests.php +++ b/app/Console/Commands/AutoRecycleClaimedTorrentRequests.php @@ -18,6 +18,7 @@ use App\Models\TorrentRequestClaim; use App\Repositories\ChatRepository; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoRecycleClaimedTorrentRequestsTest @@ -49,7 +50,7 @@ class AutoRecycleClaimedTorrentRequests extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoSoftDeleteDisabledUsers.php b/app/Console/Commands/AutoSoftDeleteDisabledUsers.php index 069b95d08..4bd8a7411 100644 --- a/app/Console/Commands/AutoSoftDeleteDisabledUsers.php +++ b/app/Console/Commands/AutoSoftDeleteDisabledUsers.php @@ -31,6 +31,7 @@ use App\Models\Torrent; use App\Models\User; use Illuminate\Console\Command; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoSoftDeleteDisabledUsersTest @@ -54,7 +55,7 @@ class AutoSoftDeleteDisabledUsers extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/AutoWarning.php b/app/Console/Commands/AutoWarning.php index af7ba54f0..1cb2f15b7 100644 --- a/app/Console/Commands/AutoWarning.php +++ b/app/Console/Commands/AutoWarning.php @@ -19,6 +19,7 @@ use App\Notifications\UserWarning; use Carbon\Carbon; use Illuminate\Console\Command; use Illuminate\Support\Facades\DB; +use Exception; /** * @see \Tests\Unit\Console\Commands\AutoWarningTest @@ -42,7 +43,7 @@ class AutoWarning extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { diff --git a/app/Console/Commands/DbLoad.php b/app/Console/Commands/DbLoad.php index f307102f8..29c5eb25e 100644 --- a/app/Console/Commands/DbLoad.php +++ b/app/Console/Commands/DbLoad.php @@ -3,6 +3,8 @@ namespace App\Console\Commands; use Illuminate\Console\Command; +use RuntimeException; +use Exception; class DbLoad extends Command { @@ -23,7 +25,7 @@ class DbLoad extends Command /** * Execute the console command. * - * @throws \Exception + * @throws Exception */ public function handle(): void { @@ -49,6 +51,6 @@ class DbLoad extends Command exec($cmd, $output, $return); - throw_if($return !== 0, new \RuntimeException(sprintf('Could not load database from file %s', $input))); + throw_if($return !== 0, new RuntimeException(sprintf('Could not load database from file %s', $input))); } } diff --git a/app/Console/Commands/GitUpdater.php b/app/Console/Commands/GitUpdater.php index 5b3a22eb7..53c809b1b 100644 --- a/app/Console/Commands/GitUpdater.php +++ b/app/Console/Commands/GitUpdater.php @@ -19,6 +19,7 @@ use Illuminate\Support\Str; use Symfony\Component\Console\Input\ArgvInput; use Symfony\Component\Console\Output\ConsoleOutput; use Symfony\Component\Console\Style\SymfonyStyle; +use RuntimeException; /** * @see \Tests\Todo\Unit\Console\Commands\GitUpdaterTest @@ -342,7 +343,7 @@ class GitUpdater extends Command { if (! is_dir(storage_path(sprintf('gitupdate/%s', $path))) && ! is_file(base_path($path))) { if (! mkdir($concurrentDirectory = storage_path(sprintf('gitupdate/%s', $path)), 0775, true) && ! is_dir($concurrentDirectory)) { - throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); + throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); } } elseif (is_file(base_path($path)) && \dirname($path) !== '.') { $path = \dirname($path); @@ -350,7 +351,7 @@ class GitUpdater extends Command 'gitupdate/%s', $path )), 0775, true) && ! is_dir($concurrentDirectory)) { - throw new \RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); + throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); } } } diff --git a/app/Console/Commands/VendorCleanup.php b/app/Console/Commands/VendorCleanup.php index c4ac2402f..43d5d5053 100644 --- a/app/Console/Commands/VendorCleanup.php +++ b/app/Console/Commands/VendorCleanup.php @@ -75,9 +75,9 @@ class VendorCleanup extends Command */ protected array $excluded = [ - /**List of Folders*/ + /*List of Folders*/ 'src', - /**List of Files*/ + /*List of Files*/ '*.php', '*.stub', '*.js', diff --git a/app/Exceptions/TrackerException.php b/app/Exceptions/TrackerException.php index 7b6b06ce9..3c63dd570 100644 --- a/app/Exceptions/TrackerException.php +++ b/app/Exceptions/TrackerException.php @@ -14,8 +14,9 @@ namespace App\Exceptions; use Throwable; +use Exception; -class TrackerException extends \Exception +class TrackerException extends Exception { protected const ERROR_MSG = [ // Error message of base Tracker system diff --git a/app/Helpers/BBCodeConverter.php b/app/Helpers/BBCodeConverter.php index cf08a4671..be8bd6463 100644 --- a/app/Helpers/BBCodeConverter.php +++ b/app/Helpers/BBCodeConverter.php @@ -13,6 +13,8 @@ namespace App\Helpers; +use RuntimeException; + class BBCodeConverter { /** @@ -105,7 +107,7 @@ class BBCodeConverter $buffer = ''; $list = preg_replace('#\s*$|^\s*#mu', '', $matches['items']); - throw_if(null === $list, new \RuntimeException('Text has malformed BBCode lists')); + throw_if(null === $list, new RuntimeException('Text has malformed BBCode lists')); $items = preg_split('#\[\*\]#u', $list); @@ -200,7 +202,7 @@ class BBCodeConverter return '['.$matches[2].']('.$matches[1].')'; } - throw new \RuntimeException('Text has malformed BBCode urls'); + throw new RuntimeException('Text has malformed BBCode urls'); }, $this->text ); @@ -290,7 +292,7 @@ class BBCodeConverter return PHP_EOL.'```'.$language.PHP_EOL.trim($matches['snippet']).PHP_EOL.'```'.PHP_EOL; } - throw new \RuntimeException('Text has malformed BBCode snippet.'); + throw new RuntimeException('Text has malformed BBCode snippet.'); }, $this->text ); diff --git a/app/Http/Controllers/AnnounceController.php b/app/Http/Controllers/AnnounceController.php index e3c8aceb0..a8f2e74f2 100644 --- a/app/Http/Controllers/AnnounceController.php +++ b/app/Http/Controllers/AnnounceController.php @@ -28,6 +28,8 @@ use App\Models\User; use Illuminate\Http\Request; use Illuminate\Http\Response; use Illuminate\Support\Facades\DB; +use Throwable; +use Exception; class AnnounceController extends Controller { @@ -82,8 +84,8 @@ class AnnounceController extends Controller /** * Announce Code. * - * @throws \Exception - * @throws \Throwable + * @throws Exception + * @throws Throwable */ public function index(Request $request, string $passkey): ?Response { @@ -140,7 +142,7 @@ class AnnounceController extends Controller * Check Client Is Valid. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ protected function checkClient(Request $request): void { @@ -185,7 +187,7 @@ class AnnounceController extends Controller * Check Passkey Exist and Valid. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ protected function checkPasskey($passkey): void { @@ -209,7 +211,7 @@ class AnnounceController extends Controller * Extract and validate Announce fields. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ private function checkAnnounceFields(Request $request): array { @@ -300,7 +302,7 @@ class AnnounceController extends Controller * Get User Via Validated Passkey. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ protected function checkUser($passkey, $queries): object { @@ -331,7 +333,7 @@ class AnnounceController extends Controller * Get Users Group. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ protected function checkGroup($user): object { @@ -376,7 +378,7 @@ class AnnounceController extends Controller * Check If Torrent Exist In Database. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ protected function checkTorrent($infoHash): object { @@ -419,7 +421,7 @@ class AnnounceController extends Controller * Check If Peer Exist In Database. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ private function checkPeer($torrent, $queries, $user): void { @@ -437,8 +439,8 @@ class AnnounceController extends Controller * Check A Peers Min Annnounce Interval. * * @throws \App\Exceptions\TrackerException - * @throws \Exception - * @throws \Throwable + * @throws Exception + * @throws Throwable */ private function checkMinInterval($torrent, $queries, $user): void { @@ -459,7 +461,7 @@ class AnnounceController extends Controller * Check A Users Max Connections. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ private function checkMaxConnections($torrent, $user): void { @@ -479,7 +481,7 @@ class AnnounceController extends Controller * Check A Users Download Slots. * * @throws \App\Exceptions\TrackerException - * @throws \Throwable + * @throws Throwable */ private function checkDownloadSlots($queries, $user, $group): void { @@ -502,7 +504,7 @@ class AnnounceController extends Controller /** * Generate A Successful Announce Response For Client. * - * @throws \Exception + * @throws Exception */ private function generateSuccessAnnounceResponse($queries, $torrent, $user): array { diff --git a/app/Http/Controllers/Auth/TwoStepController.php b/app/Http/Controllers/Auth/TwoStepController.php index 3e152143c..572860981 100644 --- a/app/Http/Controllers/Auth/TwoStepController.php +++ b/app/Http/Controllers/Auth/TwoStepController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Traits\TwoStep; use Illuminate\Http\Request; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Auth\TwoStepControllerTest @@ -88,7 +89,7 @@ class TwoStepController extends Controller /** * Show the twostep verification form. * - * @throws \Exception + * @throws Exception */ public function showVerification(): \Illuminate\Contracts\View\View { @@ -141,7 +142,7 @@ class TwoStepController extends Controller /** * Verify the user code input. * - * @throws \Exception + * @throws Exception */ public function verify(Request $request): ?\Illuminate\Http\JsonResponse { diff --git a/app/Http/Controllers/GraveyardController.php b/app/Http/Controllers/GraveyardController.php index 32efc97f2..aee4f39f4 100644 --- a/app/Http/Controllers/GraveyardController.php +++ b/app/Http/Controllers/GraveyardController.php @@ -16,6 +16,7 @@ namespace App\Http\Controllers; use App\Models\Graveyard; use App\Models\Torrent; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\GraveyardControllerTest @@ -75,7 +76,7 @@ class GraveyardController extends Controller * Cancel A Ressurection. * * - * @throws \Exception + * @throws Exception */ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 84d6e68e3..7007df446 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -27,6 +27,7 @@ use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\HomeControllerTest @@ -36,7 +37,7 @@ class HomeController extends Controller /** * Display Home Page. * - * @throws \Exception + * @throws Exception */ public function index(Request $request): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { diff --git a/app/Http/Controllers/PlaylistController.php b/app/Http/Controllers/PlaylistController.php index 7ca273174..5631ff6d5 100644 --- a/app/Http/Controllers/PlaylistController.php +++ b/app/Http/Controllers/PlaylistController.php @@ -24,6 +24,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\File; use Intervention\Image\Facades\Image; use ZipArchive; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\PlaylistControllerTest @@ -215,7 +216,7 @@ class PlaylistController extends Controller /** * Delete A Playlist. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/PlaylistTorrentController.php b/app/Http/Controllers/PlaylistTorrentController.php index c33c1b4a1..0023f9c7e 100644 --- a/app/Http/Controllers/PlaylistTorrentController.php +++ b/app/Http/Controllers/PlaylistTorrentController.php @@ -16,6 +16,7 @@ namespace App\Http\Controllers; use App\Models\Playlist; use App\Models\PlaylistTorrent; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\PlaylistTorrentControllerTest @@ -55,7 +56,7 @@ class PlaylistTorrentController extends Controller /** * Detach A Torrent From A Playlist. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index bf85221bd..93b2130a9 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -33,6 +33,7 @@ use App\Notifications\NewPostTag; use App\Repositories\ChatRepository; use Illuminate\Http\Request; use Illuminate\Support\Facades\Notification; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\PostControllerTest @@ -175,7 +176,7 @@ class PostController extends Controller /** * Delete A Post. * - * @throws \Exception + * @throws Exception */ public function postDelete(Request $request, int $postId): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/RequestController.php b/app/Http/Controllers/RequestController.php index 51385f985..facae3e2f 100644 --- a/app/Http/Controllers/RequestController.php +++ b/app/Http/Controllers/RequestController.php @@ -39,6 +39,7 @@ use App\Services\Tmdb\TMDBScraper; use Illuminate\Http\Request; use Illuminate\Support\Carbon; use MarcReichel\IGDBLaravel\Models\Game; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\RequestControllerTest @@ -501,7 +502,7 @@ class RequestController extends Controller /** * Delete A Torrent Request. * - * @throws \Exception + * @throws Exception */ public function deleteRequest(Request $request, int $id): \Illuminate\Http\RedirectResponse { @@ -556,7 +557,7 @@ class RequestController extends Controller /** * Uncliam A Torrent Request. * - * @throws \Exception + * @throws Exception */ public function unclaimRequest(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/RssController.php b/app/Http/Controllers/RssController.php index 22677a35b..9bddd9e1a 100644 --- a/app/Http/Controllers/RssController.php +++ b/app/Http/Controllers/RssController.php @@ -22,6 +22,7 @@ use App\Models\Torrent; use App\Models\Type; use App\Models\User; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\RssControllerTest @@ -143,7 +144,7 @@ class RssController extends Controller /** * Display the specified RSS resource. * - * @throws \Exception + * @throws Exception */ public function show(int $id, string $rsskey): array|\Illuminate\Http\Response { @@ -301,7 +302,7 @@ class RssController extends Controller /** * Remove the specified RSS resource from storage. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response { diff --git a/app/Http/Controllers/Staff/ApplicationController.php b/app/Http/Controllers/Staff/ApplicationController.php index 2aa3b585b..8415ad33f 100644 --- a/app/Http/Controllers/Staff/ApplicationController.php +++ b/app/Http/Controllers/Staff/ApplicationController.php @@ -23,6 +23,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Mail; use Ramsey\Uuid\Uuid; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\ApplicationControllerTest @@ -55,7 +56,7 @@ class ApplicationController extends Controller /** * Approve A Application. * - * @throws \Exception + * @throws Exception */ public function approve(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ArticleController.php b/app/Http/Controllers/Staff/ArticleController.php index c8a14831d..b8fbf2813 100644 --- a/app/Http/Controllers/Staff/ArticleController.php +++ b/app/Http/Controllers/Staff/ArticleController.php @@ -18,6 +18,7 @@ use App\Http\Requests\Staff\StoreArticleRequest; use App\Http\Requests\Staff\UpdateArticleRequest; use App\Models\Article; use Intervention\Image\Facades\Image; +use Exception; /** * @see \Tests\Feature\Http\Controllers\ArticleControllerTest @@ -91,7 +92,7 @@ class ArticleController extends Controller /** * Delete A Article. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/AuditController.php b/app/Http/Controllers/Staff/AuditController.php index 3a55f3e48..7b7d09e96 100644 --- a/app/Http/Controllers/Staff/AuditController.php +++ b/app/Http/Controllers/Staff/AuditController.php @@ -15,6 +15,7 @@ namespace App\Http\Controllers\Staff; use App\Http\Controllers\Controller; use App\Models\Audit; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\AuditControllerTest @@ -38,7 +39,7 @@ class AuditController extends Controller /** * Delete A Audit. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/BanController.php b/app/Http/Controllers/Staff/BanController.php index 4366ee005..3ded0df9a 100644 --- a/app/Http/Controllers/Staff/BanController.php +++ b/app/Http/Controllers/Staff/BanController.php @@ -22,6 +22,7 @@ use App\Models\User; use App\Notifications\UserBan; use App\Notifications\UserBanExpire; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\BanControllerTest @@ -41,7 +42,7 @@ class BanController extends Controller /** * Ban A User (current_group -> banned). * - * @throws \Exception + * @throws Exception */ public function store(StoreBanRequest $request, string $username): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/BonExchangeController.php b/app/Http/Controllers/Staff/BonExchangeController.php index 3a8b7c02b..3cbc8d30a 100644 --- a/app/Http/Controllers/Staff/BonExchangeController.php +++ b/app/Http/Controllers/Staff/BonExchangeController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreBonExchangeRequest; use App\Http\Requests\Staff\UpdateBonExchangeRequest; use App\Models\BonExchange; +use Exception; class BonExchangeController extends Controller { @@ -85,7 +86,7 @@ class BonExchangeController extends Controller /** * Destroy A Bon Exchange. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/CategoryController.php b/app/Http/Controllers/Staff/CategoryController.php index 7ecc72cbf..0b7cb35aa 100644 --- a/app/Http/Controllers/Staff/CategoryController.php +++ b/app/Http/Controllers/Staff/CategoryController.php @@ -18,6 +18,7 @@ use App\Http\Requests\Staff\StoreCategoryRequest; use App\Http\Requests\Staff\UpdateCategoryRequest; use App\Models\Category; use Intervention\Image\Facades\Image; +use Exception; /** * @see \Tests\Feature\Http\Controllers\CategoryControllerTest @@ -105,7 +106,7 @@ class CategoryController extends Controller /** * Destroy A Category. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ChatBotController.php b/app/Http/Controllers/Staff/ChatBotController.php index 4b53d0cb0..aae0a22f3 100644 --- a/app/Http/Controllers/Staff/ChatBotController.php +++ b/app/Http/Controllers/Staff/ChatBotController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\UpdateChatBotRequest; use App\Models\Bot; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\ChatBotControllerTest @@ -63,7 +64,7 @@ class ChatBotController extends Controller /** * Remove the specified Bot resource from storage. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ChatRoomController.php b/app/Http/Controllers/Staff/ChatRoomController.php index c3f428d78..96aa4910c 100644 --- a/app/Http/Controllers/Staff/ChatRoomController.php +++ b/app/Http/Controllers/Staff/ChatRoomController.php @@ -19,6 +19,7 @@ use App\Http\Requests\Staff\UpdateChatRoomRequest; use App\Models\Chatroom; use App\Models\User; use App\Repositories\ChatRepository; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\ChatRoomControllerTest @@ -87,7 +88,7 @@ class ChatRoomController extends Controller /** * Delete A Chatroom. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ChatStatusController.php b/app/Http/Controllers/Staff/ChatStatusController.php index dc69725c9..a37170d14 100644 --- a/app/Http/Controllers/Staff/ChatStatusController.php +++ b/app/Http/Controllers/Staff/ChatStatusController.php @@ -18,6 +18,7 @@ use App\Http\Requests\Staff\StoreChatStatusRequest; use App\Http\Requests\Staff\UpdateChatStatusRequest; use App\Models\ChatStatus; use App\Repositories\ChatRepository; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\ChatStatusControllerTest @@ -86,7 +87,7 @@ class ChatStatusController extends Controller /** * Delete A Chat Status. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/DistributorController.php b/app/Http/Controllers/Staff/DistributorController.php index 90ac3aadb..238ca0ee5 100644 --- a/app/Http/Controllers/Staff/DistributorController.php +++ b/app/Http/Controllers/Staff/DistributorController.php @@ -19,6 +19,7 @@ use App\Http\Requests\Staff\UpdateDistributorRequest; use App\Models\Distributor; use Illuminate\Http\Request; use Illuminate\Validation\Rule; +use Exception; class DistributorController extends Controller { @@ -86,7 +87,7 @@ class DistributorController extends Controller /** * Destroy A Distributor. * - * @throws \Exception + * @throws Exception */ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/FlushController.php b/app/Http/Controllers/Staff/FlushController.php index 8c931030a..a4351b0dc 100644 --- a/app/Http/Controllers/Staff/FlushController.php +++ b/app/Http/Controllers/Staff/FlushController.php @@ -20,6 +20,7 @@ use App\Models\Message; use App\Models\Peer; use App\Repositories\ChatRepository; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\FlushControllerTest @@ -36,7 +37,7 @@ class FlushController extends Controller /** * Flsuh All Old Peers From Database. * - * @throws \Exception + * @throws Exception */ public function peers(): \Illuminate\Http\RedirectResponse { @@ -60,7 +61,7 @@ class FlushController extends Controller /** * Flush All Chat Messages. * - * @throws \Exception + * @throws Exception */ public function chat(): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ForumController.php b/app/Http/Controllers/Staff/ForumController.php index 7463d7a26..49fe3d66f 100644 --- a/app/Http/Controllers/Staff/ForumController.php +++ b/app/Http/Controllers/Staff/ForumController.php @@ -20,6 +20,7 @@ use App\Models\Forum; use App\Models\Group; use App\Models\Permission; use Illuminate\Support\Str; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\ForumControllerTest @@ -156,7 +157,7 @@ class ForumController extends Controller /** * Delete A Forum. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/HomeController.php b/app/Http/Controllers/Staff/HomeController.php index 3737e4437..3f01f622d 100644 --- a/app/Http/Controllers/Staff/HomeController.php +++ b/app/Http/Controllers/Staff/HomeController.php @@ -19,6 +19,7 @@ use App\Models\Group; use Illuminate\Http\Request; use Illuminate\Support\Facades\DB; use Spatie\SslCertificate\SslCertificate; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\HomeControllerTest @@ -28,7 +29,7 @@ class HomeController extends Controller /** * Display Staff Dashboard. * - * @throws \Exception + * @throws Exception */ public function index(Request $request): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { diff --git a/app/Http/Controllers/Staff/MassActionController.php b/app/Http/Controllers/Staff/MassActionController.php index 556beeb0e..8b5c672af 100644 --- a/app/Http/Controllers/Staff/MassActionController.php +++ b/app/Http/Controllers/Staff/MassActionController.php @@ -18,6 +18,7 @@ use App\Http\Requests\Staff\StoreMassActionRequest; use App\Jobs\ProcessMassPM; use App\Models\Group; use App\Models\User; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\MassActionControllerTest @@ -40,7 +41,7 @@ class MassActionController extends Controller /** * Send The Mass PM. * - * @throws \Exception + * @throws Exception */ public function store(StoreMassActionRequest $request): \Illuminate\Http\RedirectResponse { @@ -61,7 +62,7 @@ class MassActionController extends Controller /** * Mass Validate Unvalidated Users. * - * @throws \Exception + * @throws Exception */ public function update(): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/MediaLanguageController.php b/app/Http/Controllers/Staff/MediaLanguageController.php index 2a238568a..b3ea0abca 100644 --- a/app/Http/Controllers/Staff/MediaLanguageController.php +++ b/app/Http/Controllers/Staff/MediaLanguageController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreMediaLanguageRequest; use App\Http\Requests\Staff\UpdateMediaLanguageRequest; use App\Models\MediaLanguage; +use Exception; class MediaLanguageController extends Controller { @@ -73,7 +74,7 @@ class MediaLanguageController extends Controller /** * Remove the specified resource from storage. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/NoteController.php b/app/Http/Controllers/Staff/NoteController.php index ca10e8df5..1da8ec940 100644 --- a/app/Http/Controllers/Staff/NoteController.php +++ b/app/Http/Controllers/Staff/NoteController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreNoteRequest; use App\Models\Note; use App\Models\User; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\NoteControllerTest @@ -49,7 +50,7 @@ class NoteController extends Controller /** * Delete A User Note. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/PageController.php b/app/Http/Controllers/Staff/PageController.php index 77c86de8b..7ef686cd0 100644 --- a/app/Http/Controllers/Staff/PageController.php +++ b/app/Http/Controllers/Staff/PageController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StorePageRequest; use App\Http\Requests\Staff\UpdatePageRequest; use App\Models\Page; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\PageControllerTest @@ -76,7 +77,7 @@ class PageController extends Controller /** * Delete A Page. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/PollController.php b/app/Http/Controllers/Staff/PollController.php index 0f8b5e1f9..350eed712 100644 --- a/app/Http/Controllers/Staff/PollController.php +++ b/app/Http/Controllers/Staff/PollController.php @@ -18,6 +18,7 @@ use App\Http\Requests\StorePoll; use App\Models\Option; use App\Models\Poll; use App\Repositories\ChatRepository; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\PollControllerTest @@ -94,7 +95,7 @@ class PollController extends Controller /** * Update A New Poll. * - * @throws \Exception + * @throws Exception */ public function update(StorePoll $storePoll, int $id): \Illuminate\Http\RedirectResponse { @@ -147,7 +148,7 @@ class PollController extends Controller /** * Delete A Poll. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/RegionController.php b/app/Http/Controllers/Staff/RegionController.php index 39d1db5d6..d958bf109 100644 --- a/app/Http/Controllers/Staff/RegionController.php +++ b/app/Http/Controllers/Staff/RegionController.php @@ -19,6 +19,7 @@ use App\Http\Requests\Staff\UpdateRegionRequest; use App\Models\Region; use Illuminate\Http\Request; use Illuminate\Validation\Rule; +use Exception; class RegionController extends Controller { @@ -75,7 +76,7 @@ class RegionController extends Controller /** * Delete A Region. * - * @throws \Exception + * @throws Exception */ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/ResolutionController.php b/app/Http/Controllers/Staff/ResolutionController.php index 289260275..b59755e53 100644 --- a/app/Http/Controllers/Staff/ResolutionController.php +++ b/app/Http/Controllers/Staff/ResolutionController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreResolutionRequest; use App\Http\Requests\Staff\UpdateResolutionRequest; use App\Models\Resolution; +use Exception; class ResolutionController extends Controller { @@ -73,7 +74,7 @@ class ResolutionController extends Controller /** * Delete A Resolution. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/RssController.php b/app/Http/Controllers/Staff/RssController.php index 85d6326a3..94534db4e 100644 --- a/app/Http/Controllers/Staff/RssController.php +++ b/app/Http/Controllers/Staff/RssController.php @@ -22,6 +22,7 @@ use App\Models\Resolution; use App\Models\Rss; use App\Models\Type; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\RssControllerTest @@ -114,7 +115,7 @@ class RssController extends Controller /** * Remove the specified RSS resource from storage. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response { diff --git a/app/Http/Controllers/Staff/SeedboxController.php b/app/Http/Controllers/Staff/SeedboxController.php index 58a5374af..b3079e768 100644 --- a/app/Http/Controllers/Staff/SeedboxController.php +++ b/app/Http/Controllers/Staff/SeedboxController.php @@ -15,6 +15,7 @@ namespace App\Http\Controllers\Staff; use App\Http\Controllers\Controller; use App\Models\Seedbox; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\SeedboxControllerTest @@ -34,7 +35,7 @@ class SeedboxController extends Controller /** * Delete A Registered Seedbox. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/TypeController.php b/app/Http/Controllers/Staff/TypeController.php index c33c83446..850cff56e 100644 --- a/app/Http/Controllers/Staff/TypeController.php +++ b/app/Http/Controllers/Staff/TypeController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreTypeRequest; use App\Http\Requests\Staff\UpdateTypeRequest; use App\Models\Type; +use Exception; /** * @see \Tests\Feature\Http\Controllers\Staff\TypeControllerTest @@ -76,7 +77,7 @@ class TypeController extends Controller /** * Delete A Type. * - * @throws \Exception + * @throws Exception */ public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/Staff/VersionController.php b/app/Http/Controllers/Staff/VersionController.php index 907ae8075..76aa27a02 100644 --- a/app/Http/Controllers/Staff/VersionController.php +++ b/app/Http/Controllers/Staff/VersionController.php @@ -15,6 +15,7 @@ namespace App\Http\Controllers\Staff; use App\Http\Controllers\Controller; use GuzzleHttp\Client; +use JsonException; /** * @see \Tests\Todo\Feature\Http\Controllers\Staff\VersionControllerTest @@ -32,7 +33,7 @@ class VersionController extends Controller * Check the latest release of UNIT3D and compare them to the local version. * * @throws \GuzzleHttp\Exception\GuzzleException - * @throws \JsonException + * @throws JsonException */ public function checkVersion(): \Illuminate\Contracts\Routing\ResponseFactory|\Illuminate\Http\Response { diff --git a/app/Http/Controllers/Staff/WatchlistController.php b/app/Http/Controllers/Staff/WatchlistController.php index 617c64749..13b17c986 100644 --- a/app/Http/Controllers/Staff/WatchlistController.php +++ b/app/Http/Controllers/Staff/WatchlistController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Http\Requests\Staff\StoreWatchedUserRequest; use App\Models\User; use App\Models\Watchlist; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\WatchlistControllerTest @@ -47,7 +48,7 @@ class WatchlistController extends Controller /** * Delete A Watched User. * - * @throws \Exception + * @throws Exception */ final public function destroy(int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/StatsController.php b/app/Http/Controllers/StatsController.php index 8ac048f1a..0d24f03cb 100644 --- a/app/Http/Controllers/StatsController.php +++ b/app/Http/Controllers/StatsController.php @@ -23,6 +23,7 @@ use App\Models\TorrentRequest; use App\Models\User; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\StatsControllerTest @@ -42,7 +43,7 @@ class StatsController extends Controller /** * Show Extra-Stats Index. * - * @throws \Exception + * @throws Exception */ public function index(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { @@ -148,7 +149,7 @@ class StatsController extends Controller /** * Show Extra-Stats Users. * - * @throws \Exception + * @throws Exception */ public function uploaded(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { @@ -166,7 +167,7 @@ class StatsController extends Controller /** * Show Extra-Stats Users. * - * @throws \Exception + * @throws Exception */ public function downloaded(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { @@ -217,7 +218,7 @@ class StatsController extends Controller /** * Show Extra-Stats Users. * - * @throws \Exception + * @throws Exception */ public function bankers(): \Illuminate\Contracts\View\Factory|\Illuminate\View\View { diff --git a/app/Http/Controllers/SubtitleController.php b/app/Http/Controllers/SubtitleController.php index a4cd5be5f..e28cd212f 100644 --- a/app/Http/Controllers/SubtitleController.php +++ b/app/Http/Controllers/SubtitleController.php @@ -32,6 +32,7 @@ use App\Models\Torrent; use App\Repositories\ChatRepository; use Illuminate\Http\Request; use Illuminate\Support\Facades\Storage; +use Exception; class SubtitleController extends Controller { @@ -168,7 +169,7 @@ class SubtitleController extends Controller /** * Remove the specified resource from storage. * - * @throws \Exception + * @throws Exception */ public function destroy(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/TopicController.php b/app/Http/Controllers/TopicController.php index ce6413ab5..7cc3a813c 100644 --- a/app/Http/Controllers/TopicController.php +++ b/app/Http/Controllers/TopicController.php @@ -31,6 +31,7 @@ use App\Models\Topic; use App\Repositories\ChatRepository; use Illuminate\Database\Eloquent\Builder; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\TopicControllerTest @@ -277,7 +278,7 @@ class TopicController extends Controller /** * Delete The Topic and The Posts. * - * @throws \Exception + * @throws Exception */ public function deleteTopic(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/TorrentController.php b/app/Http/Controllers/TorrentController.php index c747157a1..8136fefb0 100644 --- a/app/Http/Controllers/TorrentController.php +++ b/app/Http/Controllers/TorrentController.php @@ -48,6 +48,9 @@ use Illuminate\Support\Facades\Log; use Intervention\Image\Facades\Image; use MarcReichel\IGDBLaravel\Models\Game; use MarcReichel\IGDBLaravel\Models\PlatformLogo; +use Exception; +use ReflectionException; +use JsonException; /** * @see \Tests\Todo\Feature\Http\Controllers\TorrentControllerTest @@ -72,9 +75,9 @@ class TorrentController extends Controller /** * Display The Torrent reasource. * - * @throws \JsonException + * @throws JsonException * @throws \MarcReichel\IGDBLaravel\Exceptions\MissingEndpointException - * @throws \ReflectionException + * @throws ReflectionException * @throws \MarcReichel\IGDBLaravel\Exceptions\InvalidParamsException */ public function show(Request $request, int|string $id): \Illuminate\Contracts\View\Factory|\Illuminate\View\View @@ -296,7 +299,7 @@ class TorrentController extends Controller /** * Delete A Torrent. * - * @throws \Exception + * @throws Exception */ public function destroy(Request $request) { diff --git a/app/Http/Controllers/User/InviteController.php b/app/Http/Controllers/User/InviteController.php index 769150085..98ea31f69 100644 --- a/app/Http/Controllers/User/InviteController.php +++ b/app/Http/Controllers/User/InviteController.php @@ -22,6 +22,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\Mail; use Ramsey\Uuid\Uuid; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\InviteControllerTest @@ -70,7 +71,7 @@ class InviteController extends Controller /** * Send Invite. * - * @throws \Exception + * @throws Exception */ public function store(Request $request): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/NotificationController.php b/app/Http/Controllers/User/NotificationController.php index 66e53c4a9..711ec127c 100644 --- a/app/Http/Controllers/User/NotificationController.php +++ b/app/Http/Controllers/User/NotificationController.php @@ -16,6 +16,7 @@ namespace App\Http\Controllers\User; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\NotificationControllerTest @@ -68,7 +69,7 @@ class NotificationController extends Controller /** * Mass Update All Notification's To Read. * - * @throws \Exception + * @throws Exception */ public function updateAll(Request $request): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/PrivateMessageController.php b/app/Http/Controllers/User/PrivateMessageController.php index 430ad13f6..f27f25864 100644 --- a/app/Http/Controllers/User/PrivateMessageController.php +++ b/app/Http/Controllers/User/PrivateMessageController.php @@ -17,6 +17,7 @@ use App\Http\Controllers\Controller; use App\Models\PrivateMessage; use App\Models\User; use Illuminate\Http\Request; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\PrivateMessageControllerTest @@ -197,7 +198,7 @@ class PrivateMessageController extends Controller /** * Delete A Message. * - * @throws \Exception + * @throws Exception */ public function deletePrivateMessage(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/SeedboxController.php b/app/Http/Controllers/User/SeedboxController.php index 99ef4d41c..cbb42b0f6 100644 --- a/app/Http/Controllers/User/SeedboxController.php +++ b/app/Http/Controllers/User/SeedboxController.php @@ -18,6 +18,7 @@ use App\Models\Seedbox; use App\Models\User; use Illuminate\Http\Request; use Illuminate\Validation\Rule; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\SeedboxControllerTest @@ -91,7 +92,7 @@ class SeedboxController extends Controller /** * Delete A Seedbox. * - * @throws \Exception + * @throws Exception */ protected function destroy(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/UserController.php b/app/Http/Controllers/User/UserController.php index 79653c023..146c480e9 100644 --- a/app/Http/Controllers/User/UserController.php +++ b/app/Http/Controllers/User/UserController.php @@ -27,6 +27,7 @@ use Illuminate\Http\Request; use Illuminate\Support\Facades\Hash; use Illuminate\Support\Str; use Intervention\Image\Facades\Image; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\UserControllerTest @@ -284,7 +285,7 @@ class UserController extends Controller /** * Change User PID. * - * @throws \Exception + * @throws Exception */ public function changePID(Request $request, string $username): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/WarningController.php b/app/Http/Controllers/User/WarningController.php index 07de63c7b..9aa2ea1fa 100644 --- a/app/Http/Controllers/User/WarningController.php +++ b/app/Http/Controllers/User/WarningController.php @@ -19,6 +19,7 @@ use App\Models\User; use App\Models\Warning; use Illuminate\Http\Request; use Illuminate\Support\Carbon; +use Exception; /** * @see \Tests\Todo\Feature\Http\Controllers\WarningControllerTest @@ -104,7 +105,7 @@ class WarningController extends Controller * Delete A Warning. * * - * @throws \Exception + * @throws Exception */ public function deleteWarning(Request $request, int $id): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Controllers/User/WishController.php b/app/Http/Controllers/User/WishController.php index 3e393d5a6..c0efe8e8c 100644 --- a/app/Http/Controllers/User/WishController.php +++ b/app/Http/Controllers/User/WishController.php @@ -18,6 +18,7 @@ use App\Interfaces\WishInterface; use App\Models\User; use App\Services\Tmdb\Client\Movie; use Illuminate\Http\Request; +use JsonException; /** * @see \Tests\Todo\Feature\Http\Controllers\WishControllerTest @@ -52,7 +53,7 @@ class WishController extends Controller /** * Add New Wish. * - * @throws \JsonException + * @throws JsonException */ public function store(Request $request): \Illuminate\Http\RedirectResponse { diff --git a/app/Http/Middleware/CheckIfBanned.php b/app/Http/Middleware/CheckIfBanned.php index f8fe6a98b..cde3d5950 100644 --- a/app/Http/Middleware/CheckIfBanned.php +++ b/app/Http/Middleware/CheckIfBanned.php @@ -15,13 +15,14 @@ namespace App\Http\Middleware; use App\Models\Group; use Closure; +use Exception; class CheckIfBanned { /** * Handle an incoming request. * - * @throws \Exception + * @throws Exception */ public function handle(\Illuminate\Http\Request $request, Closure $next, ?string $guard = null): mixed { diff --git a/app/Http/Middleware/SetLanguage.php b/app/Http/Middleware/SetLanguage.php index a45ce1a29..73d4dffc8 100644 --- a/app/Http/Middleware/SetLanguage.php +++ b/app/Http/Middleware/SetLanguage.php @@ -17,6 +17,7 @@ use App\Models\Language; use Closure; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\App; +use Date; class SetLanguage { @@ -50,7 +51,7 @@ class SetLanguage $locale = explode('-', (string) $locale)[0]; } - \Date::setLocale($locale); + Date::setLocale($locale); } } diff --git a/app/Http/Middleware/TwoStepAuth.php b/app/Http/Middleware/TwoStepAuth.php index b57aa5b39..6d430b0d9 100644 --- a/app/Http/Middleware/TwoStepAuth.php +++ b/app/Http/Middleware/TwoStepAuth.php @@ -16,6 +16,7 @@ namespace App\Http\Middleware; use App\Traits\TwoStep; use Closure; use Illuminate\Http\Request; +use Exception; class TwoStepAuth { @@ -24,7 +25,7 @@ class TwoStepAuth /** * Handle an incoming request. * - * @throws \Exception + * @throws Exception */ public function handle(Request $request, Closure $next): mixed { diff --git a/app/Http/Resources/BotResource.php b/app/Http/Resources/BotResource.php index 0b5410fa7..af3f78022 100644 --- a/app/Http/Resources/BotResource.php +++ b/app/Http/Resources/BotResource.php @@ -14,13 +14,14 @@ namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; +use JsonSerializable; class BotResource extends JsonResource { /** * Transform the resource into an array. */ - public function toArray($request): array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + public function toArray($request): array|\Illuminate\Contracts\Support\Arrayable|JsonSerializable { return parent::toArray($request); } diff --git a/app/Http/Resources/UserResource.php b/app/Http/Resources/UserResource.php index bf6683c9f..33bb6df2a 100644 --- a/app/Http/Resources/UserResource.php +++ b/app/Http/Resources/UserResource.php @@ -14,13 +14,14 @@ namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; +use JsonSerializable; class UserResource extends JsonResource { /** * Transform the resource into an array. */ - public function toArray($request): array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable + public function toArray($request): array|\Illuminate\Contracts\Support\Arrayable|JsonSerializable { return parent::toArray($request); } diff --git a/app/Listeners/FailedLoginListener.php b/app/Listeners/FailedLoginListener.php index bbb0d42a5..49d4cf7e7 100644 --- a/app/Listeners/FailedLoginListener.php +++ b/app/Listeners/FailedLoginListener.php @@ -16,13 +16,14 @@ namespace App\Listeners; use App\Models\FailedLoginAttempt; use App\Models\Group; use App\Notifications\FailedLogin; +use Exception; class FailedLoginListener { /** * Handle the event. * - * @throws \Exception + * @throws Exception */ public function handle($event): void { diff --git a/app/Models/Peer.php b/app/Models/Peer.php index 6f1b01253..391db5fef 100644 --- a/app/Models/Peer.php +++ b/app/Models/Peer.php @@ -16,6 +16,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Support\Facades\Redis; +use Exception; class Peer extends Model { @@ -52,7 +53,7 @@ class Peer extends Model * Updates Connectable State If Needed. * * @throws \Psr\SimpleCache\InvalidArgumentException - * @throws \Exception + * @throws Exception * * @var resource */ diff --git a/app/Models/Rss.php b/app/Models/Rss.php index 7b10a722d..a92d70e2d 100644 --- a/app/Models/Rss.php +++ b/app/Models/Rss.php @@ -17,6 +17,7 @@ use App\Traits\Auditable; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\SoftDeletes; +use stdClass; class Rss extends Model { @@ -79,7 +80,7 @@ class Rss extends Model /** * Get the RSS feeds JSON Torrent as object. */ - public function getObjectTorrentAttribute(): \stdClass|bool + public function getObjectTorrentAttribute(): stdClass|bool { // Went with attribute to avoid () calls in views. Uniform ->object_torrent vs ->json_torrent. if ($this->json_torrent) { diff --git a/app/Models/Subscription.php b/app/Models/Subscription.php index 2ad2e58fd..7efa459ce 100644 --- a/app/Models/Subscription.php +++ b/app/Models/Subscription.php @@ -51,7 +51,7 @@ class Subscription extends Model } /** - * Only include subscriptions of a forum + * Only include subscriptions of a forum. */ public function scopeOfForum($query, $forum_id): Builder { @@ -59,7 +59,7 @@ class Subscription extends Model } /** - * Only include subscriptions of a topic + * Only include subscriptions of a topic. */ public function scopeOfTopic($query, $topic_id): Builder { diff --git a/app/Models/User.php b/app/Models/User.php index 7941a93f9..b1d7dc3b4 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -145,7 +145,7 @@ class User extends Authenticatable } /** - * Belongs to many followers + * Belongs to many followers. */ public function followers(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { @@ -155,7 +155,7 @@ class User extends Authenticatable } /** - * Belongs to many followees + * Belongs to many followees. */ public function following(): \Illuminate\Database\Eloquent\Relations\BelongsToMany { @@ -165,7 +165,6 @@ class User extends Authenticatable } /** - * * Has Many Messages. */ public function messages(): \Illuminate\Database\Eloquent\Relations\HasMany diff --git a/app/Models/Warning.php b/app/Models/Warning.php index e218263fe..fe361a0cc 100644 --- a/app/Models/Warning.php +++ b/app/Models/Warning.php @@ -67,7 +67,7 @@ class Warning extends Model } /** - * Active Warnings + * Active Warnings. */ public function scopeActive($query): Builder { diff --git a/app/Notifications/UserManualWarningExpire.php b/app/Notifications/UserManualWarningExpire.php index 05b2e1192..bf0a22efe 100644 --- a/app/Notifications/UserManualWarningExpire.php +++ b/app/Notifications/UserManualWarningExpire.php @@ -30,7 +30,7 @@ class UserManualWarningExpire extends Notification /** * Get the mail representation of the notification. */ - public function toMail(mixed $notifiable): \Illuminate\Notifications\Messages\MailMessage + public function toMail(mixed $notifiable): MailMessage { $profileUrl = href_profile($this->user); diff --git a/app/Notifications/UserPreWarning.php b/app/Notifications/UserPreWarning.php index 8332e4df6..4e7614daa 100644 --- a/app/Notifications/UserPreWarning.php +++ b/app/Notifications/UserPreWarning.php @@ -30,7 +30,7 @@ class UserPreWarning extends Notification /** * Get the mail representation of the notification. */ - public function toMail(mixed $notifiable): \Illuminate\Notifications\Messages\MailMessage + public function toMail(mixed $notifiable): MailMessage { $profileUrl = href_profile($this->user); diff --git a/app/Notifications/UserWarning.php b/app/Notifications/UserWarning.php index a09807d37..b0efdc1d3 100644 --- a/app/Notifications/UserWarning.php +++ b/app/Notifications/UserWarning.php @@ -30,7 +30,7 @@ class UserWarning extends Notification /** * Get the mail representation of the notification. */ - public function toMail(mixed $notifiable): \Illuminate\Notifications\Messages\MailMessage + public function toMail(mixed $notifiable): MailMessage { $profileUrl = href_profile($this->user); diff --git a/app/Notifications/UserWarningExpire.php b/app/Notifications/UserWarningExpire.php index 7da41db94..19a1d3a06 100644 --- a/app/Notifications/UserWarningExpire.php +++ b/app/Notifications/UserWarningExpire.php @@ -30,7 +30,7 @@ class UserWarningExpire extends Notification /** * Get the mail representation of the notification. */ - public function toMail(mixed $notifiable): \Illuminate\Notifications\Messages\MailMessage + public function toMail(mixed $notifiable): MailMessage { $profileUrl = href_profile($this->user); diff --git a/app/Observers/UserObserver.php b/app/Observers/UserObserver.php index 3441e77f0..3e4491f99 100644 --- a/app/Observers/UserObserver.php +++ b/app/Observers/UserObserver.php @@ -14,6 +14,7 @@ namespace App\Observers; use App\Models\User; +use Exception; class UserObserver { @@ -29,7 +30,7 @@ class UserObserver * Handle the User "saved" event. * * - * @throws \Exception + * @throws Exception */ public function saved(User $user): void { diff --git a/app/Traits/Auditable.php b/app/Traits/Auditable.php index 7999d174e..b64f36603 100644 --- a/app/Traits/Auditable.php +++ b/app/Traits/Auditable.php @@ -15,6 +15,9 @@ namespace App\Traits; use Illuminate\Support\Carbon; use Illuminate\Support\Facades\DB; +use ArgumentCountError; +use InvalidArgumentException; +use JsonException; trait Auditable { @@ -64,7 +67,7 @@ trait Auditable /** * Generates the data to store. * - * @throws \JsonException + * @throws JsonException */ protected static function generate($action, array $old = [], array $new = []): false|string { @@ -72,7 +75,7 @@ trait Auditable switch ($action) { case 'create': // Expect new data to be filled - throw_if(empty($new), new \ArgumentCountError('Action `create` expects new data.')); + throw_if(empty($new), new ArgumentCountError('Action `create` expects new data.')); // Process foreach ($new as $key => $value) { @@ -99,7 +102,7 @@ trait Auditable break; case 'delete': // Expect new data to be filled - throw_if(empty($old), new \ArgumentCountError('Action `delete` expects new data.')); + throw_if(empty($old), new ArgumentCountError('Action `delete` expects new data.')); // Process foreach ($old as $key => $value) { @@ -111,7 +114,7 @@ trait Auditable break; default: - throw new \InvalidArgumentException(sprintf('Unknown action `%s`.', $action)); + throw new InvalidArgumentException(sprintf('Unknown action `%s`.', $action)); } $clean = array_filter($data); @@ -134,7 +137,7 @@ trait Auditable /** * Logs a record creation. * - * @throws \JsonException + * @throws JsonException */ protected static function registerCreate($model): void { @@ -162,7 +165,7 @@ trait Auditable /** * Logs a record update. * - * @throws \JsonException + * @throws JsonException */ protected static function registerUpdate($model): void { @@ -190,7 +193,7 @@ trait Auditable /** * Logs a record deletion. * - * @throws \JsonException + * @throws JsonException */ protected static function registerDelete($model): void { diff --git a/app/Traits/TwoStep.php b/app/Traits/TwoStep.php index 6f45c93a9..5cc98122a 100644 --- a/app/Traits/TwoStep.php +++ b/app/Traits/TwoStep.php @@ -16,13 +16,15 @@ namespace App\Traits; use App\Models\TwoStepAuth; use App\Notifications\TwoStepAuthCode; use Illuminate\Support\Carbon; +use DateTimeInterface; +use Exception; trait TwoStep { /** * Check if the user is authorized. * - * @throws \Exception + * @throws Exception */ private function twoStepVerification(): bool { @@ -42,7 +44,7 @@ trait TwoStep /** * Check time since user was last verified and take apprpriate action. * - * @throws \Exception + * @throws Exception */ private function checkTimeSinceVerified($twoStepAuth): bool { @@ -63,7 +65,7 @@ trait TwoStep /** * Reset TwoStepAuth collection item and code. * - * @throws \Exception + * @throws Exception */ private function resetAuthStatus($twoStepAuth): mixed { @@ -81,7 +83,7 @@ trait TwoStep /** * Generate Authorization Code. * - * @throws \Exception + * @throws Exception */ private function generateCode(int $length = 4, string $prefix = '', string $suffix = ''): string { @@ -96,7 +98,7 @@ trait TwoStep * Create/retreive 2step verification object. * * - * @throws \Exception + * @throws Exception */ private function checkTwoStepAuthStatus(int $userId): TwoStepAuth|\Illuminate\Database\Eloquent\Model { @@ -123,7 +125,7 @@ trait TwoStep /** * Format verification exceeded timings with Carbon. */ - protected function exceededTimeParser(\DateTimeInterface $time): \Illuminate\Support\Collection + protected function exceededTimeParser(DateTimeInterface $time): \Illuminate\Support\Collection { $tomorrow = Carbon::parse($time)->addMinutes(config('auth.TwoStepExceededCountdownMinutes'))->format('l, F jS Y h:i:sa'); $remaining = $time->addMinutes(config('auth.TwoStepExceededCountdownMinutes'))->diffForHumans(null, true); @@ -139,7 +141,7 @@ trait TwoStep /** * Check if time since account lock has expired and return true if account verification can be reset. */ - protected function checkExceededTime(\DateTimeInterface $time): bool + protected function checkExceededTime(DateTimeInterface $time): bool { $now = Carbon::now(); $expire = Carbon::parse($time)->addMinutes(config('auth.TwoStepExceededCountdownMinutes')); @@ -150,7 +152,7 @@ trait TwoStep /** * Method to reset code and count. * - * @throws \Exception + * @throws Exception */ protected function resetExceededTime($twoStepEntry): mixed { @@ -164,7 +166,7 @@ trait TwoStep /** * Successful activation actions. * - * @throws \Exception + * @throws Exception */ protected function resetActivationCountdown($twoStepAuth): void { diff --git a/pint.json b/pint.json index 008708219..37c57fea9 100644 --- a/pint.json +++ b/pint.json @@ -6,23 +6,35 @@ "array_syntax": true, "blank_line_after_namespace": true, "blank_line_after_opening_tag": true, + "cast_spaces": true, "combine_consecutive_issets": true, "combine_consecutive_unsets": true, "concat_space": true, "declare_parentheses": true, "explicit_string_variable": true, + "fully_qualified_strict_types": true, + "function_typehint_space": true, + "global_namespace_import": true, "is_null": true, "lambda_not_used_import": true, "logical_operators": true, "method_chaining_indentation": true, "modernize_strpos": true, + "multiline_comment_opening_closing": true, "new_with_braces": true, + "no_blank_lines_after_phpdoc": true, "no_empty_comment": true, "not_operator_with_space": false, "no_superfluous_elseif": true, + "no_unused_imports": true, "no_useless_else": true, "no_useless_sprintf": true, "ordered_traits": true, + "phpdoc_align": true, + "phpdoc_order": true, + "phpdoc_scalar": true, + "phpdoc_summary": true, + "phpdoc_trim": true, "simplified_if_return": true, "simplified_null_return": true, "ternary_to_null_coalescing": true,