diff --git a/app/Bots/CasinoBot.php b/app/Bots/CasinoBot.php index 49fc45f83..d07aa8255 100644 --- a/app/Bots/CasinoBot.php +++ b/app/Bots/CasinoBot.php @@ -120,7 +120,7 @@ class CasinoBot { $donations = cache()->get('casinobot-donations'); - if (! $donations) { + if (!$donations) { $donations = BotTransaction::with('user', 'bot')->where('bot_id', '=', $this->bot->id)->where('to_bot', '=', 1)->latest()->limit(10)->get(); cache()->put('casinobot-donations', $donations, $this->expiresAt); } @@ -211,7 +211,7 @@ class CasinoBot $receiverDirty = false; $receiverEchoes = cache()->get('user-echoes'.$target->id); - if (! $receiverEchoes || ! \is_array($receiverEchoes)) { + if (!$receiverEchoes || !\is_array($receiverEchoes)) { $receiverEchoes = UserEcho::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -225,7 +225,7 @@ class CasinoBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserEcho(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; @@ -243,7 +243,7 @@ class CasinoBot $receiverDirty = false; $receiverAudibles = cache()->get('user-audibles'.$target->id); - if (! $receiverAudibles || ! \is_array($receiverAudibles)) { + if (!$receiverAudibles || !\is_array($receiverAudibles)) { $receiverAudibles = UserAudible::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -257,7 +257,7 @@ class CasinoBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserAudible(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; diff --git a/app/Bots/IRCAnnounceBot.php b/app/Bots/IRCAnnounceBot.php index 09b23ebdf..e5f340176 100644 --- a/app/Bots/IRCAnnounceBot.php +++ b/app/Bots/IRCAnnounceBot.php @@ -126,12 +126,12 @@ class IRCAnnounceBot // Channel name must begin with either `#` or `&` && \in_array($channel[0], ['#', '&'], true) // Channel names can contain any 8bit code except for SPACE, BELL, NUL, CR, LF and comma - && ! str_contains($channel, ' ') - && ! str_contains($channel, "\7") - && ! str_contains($channel, "\0") - && ! str_contains($channel, "\r") - && ! str_contains($channel, "\n") - && ! str_contains($channel, ','); + && !str_contains($channel, ' ') + && !str_contains($channel, "\7") + && !str_contains($channel, "\0") + && !str_contains($channel, "\r") + && !str_contains($channel, "\n") + && !str_contains($channel, ','); } /** @@ -163,7 +163,7 @@ class IRCAnnounceBot */ private function join(string $channel, string $key = ''): void { - if (! $this->isValidChannelName($channel)) { + if (!$this->isValidChannelName($channel)) { Log::error('Tried to join a channel with invalid name.', ['name' => $channel]); return; @@ -177,7 +177,7 @@ class IRCAnnounceBot */ private function part(string $channel): void { - if (! $this->isValidChannelName($channel)) { + if (!$this->isValidChannelName($channel)) { Log::error('Tried to part a channel with invalid name.', ['name' => $channel]); return; diff --git a/app/Bots/NerdBot.php b/app/Bots/NerdBot.php index fd0606f11..ab2ff5b93 100644 --- a/app/Bots/NerdBot.php +++ b/app/Bots/NerdBot.php @@ -354,7 +354,7 @@ class NerdBot $receiverDirty = false; $receiverEchoes = cache()->get('user-echoes'.$target->id); - if (! $receiverEchoes || ! \is_array($receiverEchoes)) { + if (!$receiverEchoes || !\is_array($receiverEchoes)) { $receiverEchoes = UserEcho::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -368,7 +368,7 @@ class NerdBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserEcho(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; @@ -386,7 +386,7 @@ class NerdBot $receiverDirty = false; $receiverAudibles = cache()->get('user-audibles'.$target->id); - if (! $receiverAudibles || ! \is_array($receiverAudibles)) { + if (!$receiverAudibles || !\is_array($receiverAudibles)) { $receiverAudibles = UserAudible::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -400,7 +400,7 @@ class NerdBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserAudible(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; diff --git a/app/Bots/SystemBot.php b/app/Bots/SystemBot.php index 690392025..e22789319 100644 --- a/app/Bots/SystemBot.php +++ b/app/Bots/SystemBot.php @@ -85,7 +85,7 @@ class SystemBot if ($v->passes()) { $recipient = User::where('username', 'LIKE', $receiver)->first(); - if (! $recipient || $recipient->id === $this->target->id) { + if (!$recipient || $recipient->id === $this->target->id) { return 'Your BON gift could not be sent.'; } @@ -184,7 +184,7 @@ class SystemBot $receiverDirty = false; $receiverEchoes = cache()->get('user-echoes'.$target->id); - if (! $receiverEchoes || ! \is_array($receiverEchoes)) { + if (!$receiverEchoes || !\is_array($receiverEchoes)) { $receiverEchoes = UserEcho::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -198,7 +198,7 @@ class SystemBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserEcho(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; @@ -216,7 +216,7 @@ class SystemBot $receiverDirty = false; $receiverAudibles = cache()->get('user-audibles'.$target->id); - if (! $receiverAudibles || ! \is_array($receiverAudibles)) { + if (!$receiverAudibles || !\is_array($receiverAudibles)) { $receiverAudibles = UserAudible::with(['room', 'target', 'bot'])->where('user_id', '=', $target->id)->get(); } @@ -230,7 +230,7 @@ class SystemBot } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserAudible(); $receiverPort->user_id = $target->id; $receiverPort->bot_id = $this->bot->id; diff --git a/app/Console/Commands/AutoCheckPeerConnectivity.php b/app/Console/Commands/AutoCheckPeerConnectivity.php index 53c999e3f..f69555c45 100644 --- a/app/Console/Commands/AutoCheckPeerConnectivity.php +++ b/app/Console/Commands/AutoCheckPeerConnectivity.php @@ -44,7 +44,7 @@ class AutoCheckPeerConnectivity extends Command */ public function handle(): void { - if (! config('announce.connectable_check')) { + if (!config('announce.connectable_check')) { return; } diff --git a/app/Console/Commands/AutoFlushPeers.php b/app/Console/Commands/AutoFlushPeers.php index 13eb6e02f..6c3fcd2a9 100644 --- a/app/Console/Commands/AutoFlushPeers.php +++ b/app/Console/Commands/AutoFlushPeers.php @@ -64,7 +64,7 @@ class AutoFlushPeers extends Command Torrent::where('id', '=', $peer->torrent_id)->update([ 'seeders' => DB::raw('seeders - '.((int) $peer->seeder)), - 'leechers' => DB::raw('leechers - '.((int) ! $peer->seeder)), + 'leechers' => DB::raw('leechers - '.((int) !$peer->seeder)), ]); $peer->active = false; diff --git a/app/Console/Commands/AutoPreWarning.php b/app/Console/Commands/AutoPreWarning.php index fe56647ce..eb9d513d4 100644 --- a/app/Console/Commands/AutoPreWarning.php +++ b/app/Console/Commands/AutoPreWarning.php @@ -65,7 +65,7 @@ class AutoPreWarning extends Command continue; } - if (! $pre->user->group->is_immune && $pre->actual_downloaded > ($pre->torrent->size * (config('hitrun.buffer') / 100))) { + if (!$pre->user->group->is_immune && $pre->actual_downloaded > ($pre->torrent->size * (config('hitrun.buffer') / 100))) { $exsist = Warning::withTrashed() ->where('torrent', '=', $pre->torrent->id) ->where('user_id', '=', $pre->user->id) diff --git a/app/Console/Commands/AutoRefundDownload.php b/app/Console/Commands/AutoRefundDownload.php index da891a127..78a156268 100644 --- a/app/Console/Commands/AutoRefundDownload.php +++ b/app/Console/Commands/AutoRefundDownload.php @@ -57,7 +57,7 @@ class AutoRefundDownload extends Command ->where('history.seedtime', '<=', $FULL_REFUND_SEEDTIME + $MIN_SEEDTIME + $COMMAND_RUN_PERIOD) ->where('history.created_at', '>=', $now->copy()->subSeconds($MIN_SEEDTIME)) ->whereColumn('torrents.user_id', '!=', 'history.user_id') - ->when(! config('other.refundable'), fn ($query) => $query->where( + ->when(!config('other.refundable'), fn ($query) => $query->where( fn ($query) => $query ->where('groups.is_refundable', '=', 1) ->orWhere('torrents.refundable', '=', 1) diff --git a/app/Console/Commands/AutoStatsClients.php b/app/Console/Commands/AutoStatsClients.php index 8320676e9..0593e6f8c 100644 --- a/app/Console/Commands/AutoStatsClients.php +++ b/app/Console/Commands/AutoStatsClients.php @@ -52,7 +52,7 @@ class AutoStatsClients extends Command ->mapWithKeys(fn ($item, $key) => [$item['agent'] => $item['count']]) ->toArray(); - if (! empty($clients)) { + if (!empty($clients)) { cache()->put('stats:clients', $clients, Carbon::now()->addMinutes(1440)); } diff --git a/app/Console/Commands/AutoWarning.php b/app/Console/Commands/AutoWarning.php index 5c7fdc8d1..87178b330 100644 --- a/app/Console/Commands/AutoWarning.php +++ b/app/Console/Commands/AutoWarning.php @@ -62,7 +62,7 @@ class AutoWarning extends Command ->get(); foreach ($hitrun as $hr) { - if (! $hr->user->group->is_immune && $hr->actual_downloaded > ($hr->torrent->size * (config('hitrun.buffer') / 100))) { + if (!$hr->user->group->is_immune && $hr->actual_downloaded > ($hr->torrent->size * (config('hitrun.buffer') / 100))) { $exsist = Warning::withTrashed() ->where('torrent', '=', $hr->torrent->id) ->where('user_id', '=', $hr->user->id) diff --git a/app/Console/Commands/DbDump.php b/app/Console/Commands/DbDump.php index 2419484fc..fc98bb98a 100644 --- a/app/Console/Commands/DbDump.php +++ b/app/Console/Commands/DbDump.php @@ -31,7 +31,7 @@ class DbDump extends Command $user = config('database.connections.mysql.username'); $password = config('database.connections.mysql.password'); - if (! $outfile) { + if (!$outfile) { $this->error('The dump file location is not set in the configuration. If you\'ve tried to set it, you may need to call "php artisan cache:clear" and/or specify the environment when calling Artisan, e.g., "php artisan --env=testing db:dump".'); return; diff --git a/app/Console/Commands/GitUpdater.php b/app/Console/Commands/GitUpdater.php index 31bf80b58..c03d35aa6 100644 --- a/app/Console/Commands/GitUpdater.php +++ b/app/Console/Commands/GitUpdater.php @@ -84,7 +84,7 @@ class GitUpdater extends Command BY PROCEEDING YOU AGREE TO THE ABOVE DISCLAIMER! USE AT YOUR OWN RISK! '); - if (! $this->io->confirm('Would you like to proceed', true)) { + if (!$this->io->confirm('Would you like to proceed', true)) { $this->line('Aborted ...'); exit(); @@ -337,24 +337,24 @@ class GitUpdater extends Command private function validatePath($path): void { - if (! is_file(base_path($path)) && ! is_dir(base_path($path))) { + if (!is_file(base_path($path)) && !is_dir(base_path($path))) { $this->red(sprintf("The path '%s' is invalid", $path)); } } private function createBackupPath($path): void { - 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)) { + 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)); } } elseif (is_file(base_path($path)) && \dirname((string) $path) !== '.') { $path = \dirname((string) $path); - if (! is_dir(storage_path(sprintf('gitupdate/%s', $path))) && ! mkdir($concurrentDirectory = storage_path(sprintf( + if (!is_dir(storage_path(sprintf('gitupdate/%s', $path))) && !mkdir($concurrentDirectory = storage_path(sprintf( 'gitupdate/%s', $path - )), 0775, true) && ! is_dir($concurrentDirectory)) { + )), 0775, true) && !is_dir($concurrentDirectory)) { throw new RuntimeException(sprintf('Directory "%s" was not created', $concurrentDirectory)); } } diff --git a/app/Console/Commands/SyncTorrentSeasonEpisode.php b/app/Console/Commands/SyncTorrentSeasonEpisode.php index fe71b8b96..ecec3bf99 100644 --- a/app/Console/Commands/SyncTorrentSeasonEpisode.php +++ b/app/Console/Commands/SyncTorrentSeasonEpisode.php @@ -40,7 +40,7 @@ class SyncTorrentSeasonEpisode extends Command { foreach (Torrent::withoutGlobalScope(ApprovedScope::class)->with(['category'])->whereNull('season_number')->orWhereNull('episode_number')->get() as $torrent) { // Skip if not TV - if (! $torrent->category->tv_meta) { + if (!$torrent->category->tv_meta) { continue; } diff --git a/app/Console/Commands/VendorCleanup.php b/app/Console/Commands/VendorCleanup.php index 0351b2bb0..37a230e10 100644 --- a/app/Console/Commands/VendorCleanup.php +++ b/app/Console/Commands/VendorCleanup.php @@ -102,7 +102,7 @@ class VendorCleanup extends Command $files = glob($directory.'/'.$casePattern, GLOB_BRACE); - if (! $files) { + if (!$files) { continue; } @@ -121,13 +121,13 @@ class VendorCleanup extends Command if (is_dir($file)) { $this->out('DELETING DIR: '.$file); - if (! $isDry) { + if (!$isDry) { $this->delTree($file); } } else { $this->out('DELETING FILE: '.$file); - if (! $isDry) { + if (!$isDry) { @unlink($file); } } @@ -162,7 +162,7 @@ class VendorCleanup extends Command */ protected function delTree(string $dir) { - if (! file_exists($dir) || ! is_dir($dir)) { + if (!file_exists($dir) || !is_dir($dir)) { return false; } diff --git a/app/Console/ConsoleTools.php b/app/Console/ConsoleTools.php index f43fede78..212e87f3c 100644 --- a/app/Console/ConsoleTools.php +++ b/app/Console/ConsoleTools.php @@ -92,7 +92,7 @@ trait ConsoleTools foreach ($commands as $command) { $process = $this->process($command, $silent); - if (! $silent) { + if (!$silent) { echo "\n\n"; $this->warn($process->getOutput()); } @@ -101,7 +101,7 @@ trait ConsoleTools private function process($command, $silent = false): Process { - if (! $silent) { + if (!$silent) { $this->cyan($command); $bar = $this->progressStart(); } @@ -117,20 +117,20 @@ trait ConsoleTools $this->red(sprintf("'%s' timed out.!", $command)); } - if (! $silent) { + if (!$silent) { $bar->advance(); } usleep(200_000); } - if (! $silent) { + if (!$silent) { $this->progressStop($bar); } $process->stop(); - if (! $process->isSuccessful()) { + if (!$process->isSuccessful()) { $this->red($process->getErrorOutput()); //die(); } diff --git a/app/Helpers/BackupPassword.php b/app/Helpers/BackupPassword.php index fded88cba..235be175b 100644 --- a/app/Helpers/BackupPassword.php +++ b/app/Helpers/BackupPassword.php @@ -36,7 +36,7 @@ class BackupPassword $this->password = config('backup.security.password'); // If no password is set, just return the backup-path - if (! $this->password) { + if (!$this->password) { return; } diff --git a/app/Helpers/Bbcode.php b/app/Helpers/Bbcode.php index 6cd411ba4..271844dde 100755 --- a/app/Helpers/Bbcode.php +++ b/app/Helpers/Bbcode.php @@ -341,7 +341,7 @@ class Bbcode } // Is the potential tag opening or closing? - if ($source[$index + 1] === '/' && ! empty($openedElements)) { + if ($source[$index + 1] === '/' && !empty($openedElements)) { $name = array_pop($openedElements); $el = $this->parsers[$name]; $tag = substr((string) $source, $index, \strlen((string) $el['closeBbcode'])); @@ -382,7 +382,7 @@ class Bbcode $index++; } - while (! empty($openedElements)) { + while (!empty($openedElements)) { $source .= $this->parsers[array_pop($openedElements)]['closeHtml']; } diff --git a/app/Helpers/Bencode.php b/app/Helpers/Bencode.php index 1d7b01bff..4ef293dcc 100644 --- a/app/Helpers/Bencode.php +++ b/app/Helpers/Bencode.php @@ -75,7 +75,7 @@ class Bencode $pos++; - if (! safe_int($lengthStr)) { + if (!safe_int($lengthStr)) { return; } @@ -170,9 +170,9 @@ class Bencode $ret = 'l'; $isDict = false; - if (! isset($d['isDct'])) { + if (!isset($d['isDct'])) { foreach (array_keys($d) as $key) { - if (! \is_int($key)) { + if (!\is_int($key)) { $isDict = true; break; diff --git a/app/Helpers/CacheUser.php b/app/Helpers/CacheUser.php index b3d208afc..fb3051635 100644 --- a/app/Helpers/CacheUser.php +++ b/app/Helpers/CacheUser.php @@ -19,7 +19,7 @@ class CacheUser { public static function user($id) { - if (! $id || $id <= 0 || ! is_numeric($id)) { + if (!$id || $id <= 0 || !is_numeric($id)) { return; } diff --git a/app/Helpers/Helpers.php b/app/Helpers/Helpers.php index 6ef5797b9..f3d7b265a 100644 --- a/app/Helpers/Helpers.php +++ b/app/Helpers/Helpers.php @@ -10,14 +10,14 @@ * @author HDVinnie * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 */ -if (! \function_exists('appurl')) { +if (!\function_exists('appurl')) { function appurl() { return config('app.url'); } } -if (! \function_exists('href_profile')) { +if (!\function_exists('href_profile')) { function href_profile($user) { $appurl = appurl(); @@ -26,7 +26,7 @@ if (! \function_exists('href_profile')) { } } -if (! \function_exists('href_article')) { +if (!\function_exists('href_article')) { function href_article($article) { $appurl = appurl(); @@ -35,7 +35,7 @@ if (! \function_exists('href_article')) { } } -if (! \function_exists('href_torrent')) { +if (!\function_exists('href_torrent')) { function href_torrent($torrent) { $appurl = appurl(); @@ -44,7 +44,7 @@ if (! \function_exists('href_torrent')) { } } -if (! \function_exists('href_request')) { +if (!\function_exists('href_request')) { function href_request($torrentRequest) { $appurl = appurl(); @@ -53,7 +53,7 @@ if (! \function_exists('href_request')) { } } -if (! \function_exists('href_poll')) { +if (!\function_exists('href_poll')) { function href_poll($poll) { $appurl = appurl(); @@ -62,7 +62,7 @@ if (! \function_exists('href_poll')) { } } -if (! \function_exists('href_playlist')) { +if (!\function_exists('href_playlist')) { function href_playlist($playlist) { $appurl = appurl(); @@ -71,7 +71,7 @@ if (! \function_exists('href_playlist')) { } } -if (! \function_exists('href_collection')) { +if (!\function_exists('href_collection')) { function href_collection($collection) { $appurl = appurl(); @@ -80,7 +80,7 @@ if (! \function_exists('href_collection')) { } } -if (! \function_exists('tmdb_image')) { +if (!\function_exists('tmdb_image')) { function tmdb_image($type, $original) { $new = match ($type) { @@ -102,14 +102,14 @@ if (! \function_exists('tmdb_image')) { } } -if (! \function_exists('modal_style')) { +if (!\function_exists('modal_style')) { function modal_style() { return (auth()->user()->style == 0) ? '' : ' modal-dark'; } } -if (! \function_exists('rating_color')) { +if (!\function_exists('rating_color')) { function rating_color($number) { $rating = round((float) $number); @@ -128,7 +128,7 @@ if (! \function_exists('rating_color')) { } } -if (! \function_exists('language_flag')) { +if (!\function_exists('language_flag')) { function language_flag($language) { $flag = match ($language) { diff --git a/app/Helpers/HiddenCaptcha.php b/app/Helpers/HiddenCaptcha.php index 780f78267..d3e5aab91 100644 --- a/app/Helpers/HiddenCaptcha.php +++ b/app/Helpers/HiddenCaptcha.php @@ -52,12 +52,12 @@ class HiddenCaptcha $formData = $validator->getData(); // Check post values - if (! isset($formData['_captcha']) || ! ($token = self::getToken($formData['_captcha']))) { + if (!isset($formData['_captcha']) || !($token = self::getToken($formData['_captcha']))) { return false; } // Hidden "must be empty" field check - if (! \array_key_exists($token['must_be_empty'], $formData) || ! empty($formData[$token['must_be_empty']])) { + if (!\array_key_exists($token['must_be_empty'], $formData) || !empty($formData[$token['must_be_empty']])) { return false; } @@ -94,7 +94,7 @@ class HiddenCaptcha $token = @unserialize($token); // Token is null or unserializable - if (! $token || ! \is_array($token)) { + if (!$token || !\is_array($token)) { return false; } diff --git a/app/Helpers/Language.php b/app/Helpers/Language.php index ee4056026..0dc25040e 100644 --- a/app/Helpers/Language.php +++ b/app/Helpers/Language.php @@ -10,7 +10,7 @@ * @author HDVinnie * @license https://www.gnu.org/licenses/agpl-3.0.en.html/ GNU Affero General Public License v3.0 */ -if (! \function_exists('language')) { +if (!\function_exists('language')) { /** * Get the language instance. */ diff --git a/app/Helpers/Markdown.php b/app/Helpers/Markdown.php index 4b5b42def..3b106c108 100644 --- a/app/Helpers/Markdown.php +++ b/app/Helpers/Markdown.php @@ -231,7 +231,7 @@ class Markdown if (isset($Block)) { $Block['type'] = $blockType; - if (! isset($Block['identified'])) { + if (!isset($Block['identified'])) { if (isset($CurrentBlock)) { $Elements[] = $this->extractElement($CurrentBlock); } @@ -288,7 +288,7 @@ class Markdown protected function extractElement(array $Component) { - if (! isset($Component['element'])) { + if (!isset($Component['element'])) { if (isset($Component['markup'])) { $Component['element'] = ['rawHtml' => $Component['markup']]; } elseif (isset($Component['hidden'])) { @@ -314,7 +314,7 @@ class Markdown protected function blockCode($Line, $Block = null) { - if (isset($Block) && $Block['type'] === 'Paragraph' && ! isset($Block['interrupted'])) { + if (isset($Block) && $Block['type'] === 'Paragraph' && !isset($Block['interrupted'])) { return; } @@ -551,7 +551,7 @@ class Markdown if ($listStart !== '1') { if ( - isset($CurrentBlock) && $CurrentBlock['type'] === 'Paragraph' && ! isset($CurrentBlock['interrupted']) + isset($CurrentBlock) && $CurrentBlock['type'] === 'Paragraph' && !isset($CurrentBlock['interrupted']) ) { return; } @@ -639,7 +639,7 @@ class Markdown return $Block; } - if (! isset($Block['interrupted'])) { + if (!isset($Block['interrupted'])) { $text = preg_replace('/^[ ]{0,'.$requiredIndent.'}+/', '', (string) $Line['body']); $Block['li']['handler']['argument'][] = $text; @@ -692,7 +692,7 @@ class Markdown return $Block; } - if (! isset($Block['interrupted'])) { + if (!isset($Block['interrupted'])) { $Block['element']['handler']['argument'][] = $Line['text']; return $Block; @@ -720,7 +720,7 @@ class Markdown protected function blockSetextHeader($Line, array $Block = null) { - if (! isset($Block) || $Block['type'] !== 'Paragraph' || isset($Block['interrupted'])) { + if (!isset($Block) || $Block['type'] !== 'Paragraph' || isset($Block['interrupted'])) { return; } @@ -795,12 +795,12 @@ class Markdown protected function blockTable($Line, array $Block = null) { - if (! isset($Block) || $Block['type'] !== 'Paragraph' || isset($Block['interrupted'])) { + if (!isset($Block) || $Block['type'] !== 'Paragraph' || isset($Block['interrupted'])) { return; } if ( - (! str_contains((string) $Block['element']['handler']['argument'], '|') && ! str_contains((string) $Line['text'], '|') && ! str_contains( + (!str_contains((string) $Block['element']['handler']['argument'], '|') && !str_contains((string) $Line['text'], '|') && !str_contains( (string) $Line['text'], ':' )) || str_contains((string) $Block['element']['handler']['argument'], "\n") @@ -1048,7 +1048,7 @@ class Markdown $Inline = $this->{sprintf('inline%s', $inlineType)}($Excerpt); - if (! isset($Inline)) { + if (!isset($Inline)) { continue; } @@ -1060,7 +1060,7 @@ class Markdown // sets a default inline position - if (! isset($Inline['position'])) { + if (!isset($Inline['position'])) { $Inline['position'] = $markerPosition; } @@ -1100,7 +1100,7 @@ class Markdown $Elements[] = $InlineText['element']; foreach ($Elements as &$Element) { - if (! isset($Element['autobreak'])) { + if (!isset($Element['autobreak'])) { $Element['autobreak'] = false; } } @@ -1160,7 +1160,7 @@ class Markdown ) { $url = $matches[1]; - if (! isset($matches[2])) { + if (!isset($matches[2])) { $url = sprintf('mailto:%s', $url); } @@ -1179,7 +1179,7 @@ class Markdown protected function inlineEmphasis($Excerpt) { - if (! isset($Excerpt['text'][1])) { + if (!isset($Excerpt['text'][1])) { return; } @@ -1218,7 +1218,7 @@ class Markdown protected function inlineImage($Excerpt) { - if (! isset($Excerpt['text'][1]) || $Excerpt['text'][1] !== '[') { + if (!isset($Excerpt['text'][1]) || $Excerpt['text'][1] !== '[') { return; } @@ -1297,7 +1297,7 @@ class Markdown $definition = strtolower($Element['handler']['argument']); } - if (! isset($this->DefinitionData['Reference'][$definition])) { + if (!isset($this->DefinitionData['Reference'][$definition])) { return; } @@ -1315,7 +1315,7 @@ class Markdown protected function inlineMarkup($Excerpt) { - if ($this->markupEscaped || $this->safeMode || ! str_contains((string) $Excerpt['text'], '>')) { + if ($this->markupEscaped || $this->safeMode || !str_contains((string) $Excerpt['text'], '>')) { return; } @@ -1354,7 +1354,7 @@ class Markdown protected function inlineStrikethrough($Excerpt) { - if (! isset($Excerpt['text'][1])) { + if (!isset($Excerpt['text'][1])) { return; } @@ -1375,7 +1375,7 @@ class Markdown protected function inlineUrl($Excerpt) { - if ($this->urlsLinked !== true || ! isset($Excerpt['text'][2]) || $Excerpt['text'][2] !== '/') { + if ($this->urlsLinked !== true || !isset($Excerpt['text'][2]) || $Excerpt['text'][2] !== '/') { return; } @@ -1431,7 +1431,7 @@ class Markdown protected function handle(array $Element) { if (isset($Element['handler'])) { - if (! isset($Element['nonNestables'])) { + if (!isset($Element['nonNestables'])) { $Element['nonNestables'] = []; } @@ -1548,7 +1548,7 @@ class Markdown $text = $Element['rawHtml']; $allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode']; - $permitRawHtml = ! $this->safeMode || $allowRawHtmlInSafeMode; + $permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode; } $hasContent = isset($text) || isset($Element['element']) || isset($Element['elements']); @@ -1560,7 +1560,7 @@ class Markdown $markup .= $this->elements($Element['elements']); } elseif (isset($Element['element'])) { $markup .= $this->element($Element['element']); - } elseif (! $permitRawHtml) { + } elseif (!$permitRawHtml) { $markup .= self::escape($text, true); } else { $markup .= $text; @@ -1604,7 +1604,7 @@ class Markdown { $Elements = $this->linesElements($lines); - if (isset($Elements[0], $Elements[0]['name']) && ! \in_array('', $lines) && $Elements[0]['name'] === 'p' + if (isset($Elements[0], $Elements[0]['name']) && !\in_array('', $lines) && $Elements[0]['name'] === 'p' ) { unset($Elements[0]['name']); } @@ -1660,7 +1660,7 @@ class Markdown 'img' => 'src', ]; - if (! isset($Element['name'])) { + if (!isset($Element['name'])) { unset($Element['attributes']); return $Element; @@ -1670,10 +1670,10 @@ class Markdown $Element = $this->filterUnsafeUrlInAttribute($Element, $safeUrlNameToAtt[$Element['name']]); } - if (! empty($Element['attributes'])) { + if (!empty($Element['attributes'])) { foreach (array_keys($Element['attributes']) as $att) { // filter out badly parsed attribute - if (! preg_match($goodAttribute, (string) $att)) { + if (!preg_match($goodAttribute, (string) $att)) { unset($Element['attributes'][$att]); } // dump onevent attribute diff --git a/app/Helpers/MarkdownExtra.php b/app/Helpers/MarkdownExtra.php index 6468adf97..11fcbac87 100644 --- a/app/Helpers/MarkdownExtra.php +++ b/app/Helpers/MarkdownExtra.php @@ -123,7 +123,7 @@ class MarkdownExtra extends Markdown protected function blockDefinitionList($Line, $Block) { - if (! isset($Block) || $Block['type'] !== 'Paragraph') { + if (!isset($Block) || $Block['type'] !== 'Paragraph') { return; } @@ -271,7 +271,7 @@ class MarkdownExtra extends Markdown protected function blockMarkupComplete($Block) { - if (! isset($Block['void'])) { + if (!isset($Block['void'])) { $Block['element']['rawHtml'] = $this->processTag($Block['element']['rawHtml']); } @@ -308,13 +308,13 @@ class MarkdownExtra extends Markdown if (preg_match('#^\[\^(.+?)\]#', (string) $Excerpt['text'], $matches)) { $name = $matches[1]; - if (! isset($this->DefinitionData['Footnote'][$name])) { + if (!isset($this->DefinitionData['Footnote'][$name])) { return; } $this->DefinitionData['Footnote'][$name]['count']++; - if (! isset($this->DefinitionData['Footnote'][$name]['number'])) { + if (!isset($this->DefinitionData['Footnote'][$name]['number'])) { $this->DefinitionData['Footnote'][$name]['number'] = ++$this->footnoteCount; // ยป & } @@ -453,7 +453,7 @@ class MarkdownExtra extends Markdown uasort($this->DefinitionData['Footnote'], 'self::sortFootnotes'); foreach ($this->DefinitionData['Footnote'] as $definitionId => $DefinitionData) { - if (! isset($DefinitionData['number'])) { + if (!isset($DefinitionData['number'])) { continue; } @@ -571,7 +571,7 @@ class MarkdownExtra extends Markdown foreach ($DOMDocument->documentElement->childNodes as $Node) { $nodeMarkup = $DOMDocument->saveHTML($Node); - if ($Node instanceof DOMElement && ! \in_array($Node->nodeName, $this->textLevelElements)) { + if ($Node instanceof DOMElement && !\in_array($Node->nodeName, $this->textLevelElements)) { $elementText .= $this->processTag($nodeMarkup); } else { $elementText .= $nodeMarkup; diff --git a/app/Helpers/MediaInfo.php b/app/Helpers/MediaInfo.php index b4b703d5b..ad47fe2b9 100644 --- a/app/Helpers/MediaInfo.php +++ b/app/Helpers/MediaInfo.php @@ -70,7 +70,7 @@ class MediaInfo foreach ($sections as $key => $section) { $keySection = strtolower(explode(' ', $key)[0]); - if (! empty($section)) { + if (!empty($section)) { if ($keySection === 'general') { $output[$keySection] = $this->parseProperty($section, $keySection); } else { @@ -327,7 +327,7 @@ class MediaInfo $number = (float) str_replace(' ', '', (string) $string); preg_match('/[KMGTPEZ]/i', (string) $string, $size); - if (! empty($size[0])) { + if (!empty($size[0])) { $number = $this->computerSize($number, $size[0].'b'); } diff --git a/app/Helpers/SystemInformation.php b/app/Helpers/SystemInformation.php index 0d8a71194..3a2822998 100644 --- a/app/Helpers/SystemInformation.php +++ b/app/Helpers/SystemInformation.php @@ -118,7 +118,7 @@ class SystemInformation private function getDatabase(): string { - if (! \in_array(config('database.default'), self::KNOWN_DATABASES, true)) { + if (!\in_array(config('database.default'), self::KNOWN_DATABASES, true)) { return 'Unkown'; } diff --git a/app/Helpers/TorrentTools.php b/app/Helpers/TorrentTools.php index b6fa50dbc..fa30be8a8 100644 --- a/app/Helpers/TorrentTools.php +++ b/app/Helpers/TorrentTools.php @@ -143,7 +143,7 @@ class TorrentTools $count = is_countable($file['path']) ? \count($file['path']) : 0; for ($i = 0; $i < $count; $i++) { - if (! \in_array($file['path'][$i], $filenames)) { + if (!\in_array($file['path'][$i], $filenames)) { $filenames[] = $file['path'][$i]; } } diff --git a/app/Http/Controllers/API/BaseController.php b/app/Http/Controllers/API/BaseController.php index 729f7e172..41a029075 100644 --- a/app/Http/Controllers/API/BaseController.php +++ b/app/Http/Controllers/API/BaseController.php @@ -35,7 +35,7 @@ class BaseController extends Controller 'message' => $error, ]; - if (! empty($errorMessages)) { + if (!empty($errorMessages)) { $response['data'] = $errorMessages; } diff --git a/app/Http/Controllers/API/ChatController.php b/app/Http/Controllers/API/ChatController.php index c441783af..916b5db53 100644 --- a/app/Http/Controllers/API/ChatController.php +++ b/app/Http/Controllers/API/ChatController.php @@ -55,7 +55,7 @@ class ChatController extends Controller { $user = $request->user()->load(['echoes']); - if (! $user->echoes || (is_countable($user->echoes->toArray()) ? \count($user->echoes->toArray()) : 0) < 1) { + if (!$user->echoes || (is_countable($user->echoes->toArray()) ? \count($user->echoes->toArray()) : 0) < 1) { $userEcho = new UserEcho(); $userEcho->user_id = $request->user()->id; $userEcho->room_id = 1; @@ -70,7 +70,7 @@ class ChatController extends Controller { $user = $request->user()->load(['audibles']); - if (! $user->audibles || (is_countable($user->audibles->toArray()) ? \count($user->audibles->toArray()) : 0) < 1) { + if (!$user->audibles || (is_countable($user->audibles->toArray()) ? \count($user->audibles->toArray()) : 0) < 1) { $userAudible = new UserAudible(); $userAudible->user_id = $request->user()->id; $userAudible->room_id = 1; @@ -152,7 +152,7 @@ class ChatController extends Controller $botDirty = 0; $bots = cache()->get('bots'); - if (! $bots || ! \is_array($bots) || \count($bots) < 1) { + if (!$bots || !\is_array($bots) || \count($bots) < 1) { $bots = Bot::where('active', '=', 1)->oldest('position')->get(); $botDirty = 1; } @@ -225,7 +225,7 @@ class ChatController extends Controller } } - if ($which != null && $which != 'skip' && ! $runbot) { + if ($which != null && $which != 'skip' && !$runbot) { if ($bot->is_systembot) { $runbot = new SystemBot($this->chatRepository); } elseif ($bot->is_nerdbot) { @@ -247,11 +247,11 @@ class ChatController extends Controller $senderEchoes = cache()->get('user-echoes'.$userId); $receiverEchoes = cache()->get('user-echoes'.$receiverId); - if (! $senderEchoes || ! \is_array($senderEchoes) || \count($senderEchoes) < 1) { + if (!$senderEchoes || !\is_array($senderEchoes) || \count($senderEchoes) < 1) { $senderEchoes = UserEcho::with(['room', 'target', 'bot'])->where('user_id', $userId)->get(); } - if (! $receiverEchoes || ! \is_array($receiverEchoes) || \count($receiverEchoes) < 1) { + if (!$receiverEchoes || !\is_array($receiverEchoes) || \count($receiverEchoes) < 1) { $receiverEchoes = UserEcho::with(['room', 'target', 'bot'])->whereRaw('user_id = ?', [$receiverId])->get(); } @@ -263,7 +263,7 @@ class ChatController extends Controller } } - if (! $senderListening) { + if (!$senderListening) { $senderPort = new UserEcho(); $senderPort->user_id = $userId; $senderPort->target_id = $receiverId; @@ -280,7 +280,7 @@ class ChatController extends Controller } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserEcho(); $receiverPort->user_id = $receiverId; $receiverPort->target_id = $userId; @@ -306,11 +306,11 @@ class ChatController extends Controller $senderAudibles = cache()->get('user-audibles'.$userId); $receiverAudibles = cache()->get('user-audibles'.$receiverId); - if (! $senderAudibles || ! \is_array($senderAudibles) || \count($senderAudibles) < 1) { + if (!$senderAudibles || !\is_array($senderAudibles) || \count($senderAudibles) < 1) { $senderAudibles = UserAudible::with(['room', 'target', 'bot'])->where('user_id', $userId)->get(); } - if (! $receiverAudibles || ! \is_array($receiverAudibles) || \count($receiverAudibles) < 1) { + if (!$receiverAudibles || !\is_array($receiverAudibles) || \count($receiverAudibles) < 1) { $receiverAudibles = UserAudible::with(['room', 'target', 'bot'])->whereRaw('user_id = ?', [$receiverId])->get(); } @@ -322,7 +322,7 @@ class ChatController extends Controller } } - if (! $senderListening) { + if (!$senderListening) { $senderPort = new UserAudible(); $senderPort->user_id = $userId; $senderPort->target_id = $receiverId; @@ -340,7 +340,7 @@ class ChatController extends Controller } } - if (! $receiverListening) { + if (!$receiverListening) { $receiverPort = new UserAudible(); $receiverPort->user_id = $receiverId; $receiverPort->target_id = $userId; @@ -373,7 +373,7 @@ class ChatController extends Controller $message = $this->chatRepository->message($userId, $roomId, $message, $receiverId, $botId); } - if (! $save) { + if (!$save) { $message->delete(); } @@ -392,7 +392,7 @@ class ChatController extends Controller $changedByStaff = $request->user()->id !== $message->user_id; - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $message->user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $message->user->group->level, 403); $this->chatRepository->deleteMessage($id); @@ -455,7 +455,7 @@ class ChatController extends Controller { $user = $request->user(); $echo = UserAudible::where('user_id', '=', $user->id)->where('room_id', '=', $request->input('room_id'))->sole(); - $echo->status = ! $echo->status; + $echo->status = !$echo->status; $echo->save(); $user->load(['chatStatus', 'chatroom', 'group', 'audibles', 'audibles']); @@ -472,7 +472,7 @@ class ChatController extends Controller { $user = $request->user(); $echo = UserAudible::where('user_id', '=', $user->id)->where('target_id', '=', $request->input('target_id'))->sole(); - $echo->status = ! $echo->status; + $echo->status = !$echo->status; $echo->save(); $user->load(['chatStatus', 'chatroom', 'group', 'audibles', 'audibles']); @@ -489,7 +489,7 @@ class ChatController extends Controller { $user = $request->user(); $echo = UserAudible::where('user_id', '=', $user->id)->where('bot_id', '=', $request->input('bot_id'))->sole(); - $echo->status = ! $echo->status; + $echo->status = !$echo->status; $echo->save(); $user->load(['chatStatus', 'chatroom', 'group', 'audibles', 'audibles'])->findOrFail($user->id); @@ -537,7 +537,7 @@ class ChatController extends Controller $senderDirty = 0; $senderEchoes = cache()->get('user-echoes'.$user->id); - if (! $senderEchoes || ! \is_array($senderEchoes) || \count($senderEchoes) < 1) { + if (!$senderEchoes || !\is_array($senderEchoes) || \count($senderEchoes) < 1) { $senderEchoes = UserEcho::with(['room', 'target', 'bot'])->where('user_id', '=', $user->id)->get(); } @@ -549,7 +549,7 @@ class ChatController extends Controller } } - if (! $senderListening) { + if (!$senderListening) { $userEcho = new UserEcho(); $userEcho->user_id = $user->id; $userEcho->room_id = $room->id; diff --git a/app/Http/Controllers/API/TorrentController.php b/app/Http/Controllers/API/TorrentController.php index 991d29cdb..8f00901ed 100644 --- a/app/Http/Controllers/API/TorrentController.php +++ b/app/Http/Controllers/API/TorrentController.php @@ -101,7 +101,7 @@ class TorrentController extends BaseController $requestFile = $request->file('torrent'); - if (! $request->hasFile('torrent')) { + if (!$request->hasFile('torrent')) { return $this->sendError('Validation Error.', 'You Must Provide A Torrent File For Upload!'); } @@ -120,7 +120,7 @@ class TorrentController extends BaseController } foreach (TorrentTools::getFilenameArray($decodedTorrent) as $name) { - if (! TorrentTools::isValidFilename($name)) { + if (!TorrentTools::isValidFilename($name)) { return $this->sendError('Validation Error.', 'Invalid Filenames In Torrent Files!'); } } diff --git a/app/Http/Controllers/AnnounceController.php b/app/Http/Controllers/AnnounceController.php index ad9fa99bb..c1722381e 100644 --- a/app/Http/Controllers/AnnounceController.php +++ b/app/Http/Controllers/AnnounceController.php @@ -149,7 +149,7 @@ final class AnnounceController extends Controller } // Miss Header User-Agent is not allowed. - if (! $request->header('User-Agent')) { + if (!$request->header('User-Agent')) { throw new TrackerException(120); } @@ -244,7 +244,7 @@ final class AnnounceController extends Controller foreach (['uploaded', 'downloaded', 'left'] as $item) { $itemData = $queries[$item]; - if (! is_numeric($itemData) || $itemData < 0) { + if (!is_numeric($itemData) || $itemData < 0) { throw new TrackerException(134, [':attribute' => $item]); } } @@ -260,14 +260,14 @@ final class AnnounceController extends Controller } foreach (['numwant', 'corrupt'] as $item) { - if (! is_numeric($queries[$item]) || $queries[$item] < 0) { + if (!is_numeric($queries[$item]) || $queries[$item] < 0) { throw new TrackerException(134, [':attribute' => $item]); } } $queries['event'] = strtolower($queries['event']); - if (! \in_array($queries['event'], ['started', 'completed', 'stopped', 'paused', ''])) { + if (!\in_array($queries['event'], ['started', 'completed', 'stopped', 'paused', ''])) { throw new TrackerException(136, [':event' => $queries['event']]); } @@ -281,7 +281,7 @@ final class AnnounceController extends Controller } if ( - ! is_numeric($queries['port']) + !is_numeric($queries['port']) || $queries['port'] < 0 || $queries['port'] > 0xFFFF || \in_array($queries['port'], self::BLACK_PORTS, true) @@ -471,7 +471,7 @@ final class AnnounceController extends Controller // least 5 minutes since they last announced. if ($event === 'stopped' && $lastAnnouncedAt < $now - 5 * 60) { Redis::connection('announce')->command('DEL', [$lastAnnouncedKey]); - } elseif ($lastAnnouncedAt !== false && ! \in_array($event, ['completed', 'stopped'])) { + } elseif ($lastAnnouncedAt !== false && !\in_array($event, ['completed', 'stopped'])) { throw new TrackerException(162, [':elapsed' => $now - $lastAnnouncedAt]); } } @@ -519,10 +519,10 @@ final class AnnounceController extends Controller $isDeadPeer = $queries['event'] === 'stopped'; $isSeeder = $queries['left'] == 0; - $newLeech = $isNewPeer && ! $isDeadPeer && ! $isSeeder; - $stoppedLeech = ! $isNewPeer && $isDeadPeer && ! $isSeeder; - $leechBecomesSeed = ! $isNewPeer && ! $isDeadPeer && $isSeeder && $peer->left > 0; - $seedBecomesLeech = ! $isNewPeer && ! $isDeadPeer && ! $isSeeder && $peer->left === 0; + $newLeech = $isNewPeer && !$isDeadPeer && !$isSeeder; + $stoppedLeech = !$isNewPeer && $isDeadPeer && !$isSeeder; + $leechBecomesSeed = !$isNewPeer && !$isDeadPeer && $isSeeder && $peer->left > 0; + $seedBecomesLeech = !$isNewPeer && !$isDeadPeer && !$isSeeder && $peer->left === 0; if ($max !== null && $max >= 0 && ($newLeech || $seedBecomesLeech) && $count >= $max) { throw new TrackerException(164, [':max' => $max]); @@ -571,7 +571,7 @@ final class AnnounceController extends Controller if ($queries['left'] == 0) { foreach ($torrent->peers as $peer) { // Don't include other seeders, inactive peers, nor other peers belonging to the same user - if ($peer->seeder || ! $peer->active || $peer->user_id === $user->id) { + if ($peer->seeder || !$peer->active || $peer->user_id === $user->id) { continue; } @@ -593,7 +593,7 @@ final class AnnounceController extends Controller } else { foreach ($torrent->peers as $peer) { // Don't include inactive peers, nor other peers belonging to the same user - if (! $peer->active || $peer->user_id === $user->id) { + if (!$peer->active || $peer->user_id === $user->id) { continue; } @@ -766,16 +766,16 @@ final class AnnounceController extends Controller // Torrent updates - $isNewPeer = $isNewPeer || ! $peer->active; + $isNewPeer = $isNewPeer || !$peer->active; $isDeadPeer = $event === 'stopped'; $isSeeder = $queries['left'] == 0; - $newSeed = $isNewPeer && ! $isDeadPeer && $isSeeder; - $newLeech = $isNewPeer && ! $isDeadPeer && ! $isSeeder; - $stoppedSeed = ! $isNewPeer && $isDeadPeer && $isSeeder; - $stoppedLeech = ! $isNewPeer && $isDeadPeer && ! $isSeeder; - $leechBecomesSeed = ! $isNewPeer && ! $isDeadPeer && $isSeeder && $peer->left > 0; - $seedBecomesLeech = ! $isNewPeer && ! $isDeadPeer && ! $isSeeder && $peer->left === 0; + $newSeed = $isNewPeer && !$isDeadPeer && $isSeeder; + $newLeech = $isNewPeer && !$isDeadPeer && !$isSeeder; + $stoppedSeed = !$isNewPeer && $isDeadPeer && $isSeeder; + $stoppedLeech = !$isNewPeer && $isDeadPeer && !$isSeeder; + $leechBecomesSeed = !$isNewPeer && !$isDeadPeer && $isSeeder && $peer->left > 0; + $seedBecomesLeech = !$isNewPeer && !$isDeadPeer && !$isSeeder && $peer->left === 0; $seederCountDelta = ($newSeed || $leechBecomesSeed) <=> ($stoppedSeed || $seedBecomesLeech); $leecherCountDelta = ($newLeech || $seedBecomesLeech) <=> ($stoppedLeech || $leechBecomesSeed); diff --git a/app/Http/Controllers/ApprovedRequestFillController.php b/app/Http/Controllers/ApprovedRequestFillController.php index 012a3d9e7..a11459c41 100644 --- a/app/Http/Controllers/ApprovedRequestFillController.php +++ b/app/Http/Controllers/ApprovedRequestFillController.php @@ -63,7 +63,7 @@ class ApprovedRequestFillController extends Controller $filler->increment('seedbonus', $torrentRequest->bounty); // Achievements - if (! $torrentRequest->filled_anon) { + if (!$torrentRequest->filled_anon) { $filler->addProgress(new UserFilled25Requests(), 1); $filler->addProgress(new UserFilled50Requests(), 1); $filler->addProgress(new UserFilled75Requests(), 1); diff --git a/app/Http/Controllers/Auth/ApplicationController.php b/app/Http/Controllers/Auth/ApplicationController.php index e594eec7d..e0eb82a22 100644 --- a/app/Http/Controllers/Auth/ApplicationController.php +++ b/app/Http/Controllers/Auth/ApplicationController.php @@ -44,7 +44,7 @@ class ApplicationController extends Controller $application->referrer = $request->input('referrer'); if (config('email-blacklist.enabled')) { - if (! config('captcha.enabled')) { + if (!config('captcha.enabled')) { $v = validator($request->all(), [ 'type' => 'required', 'email' => [ @@ -84,7 +84,7 @@ class ApplicationController extends Controller 'captcha' => 'hiddencaptcha', ]); } - } elseif (! config('captcha.enabled')) { + } elseif (!config('captcha.enabled')) { $v = validator($request->all(), [ 'type' => 'required', 'email' => 'required|string|email|max:70|unique:invites|unique:users|unique:applications', diff --git a/app/Http/Controllers/Auth/ForgotPasswordController.php b/app/Http/Controllers/Auth/ForgotPasswordController.php index d632eed2d..0d0581be7 100644 --- a/app/Http/Controllers/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/Auth/ForgotPasswordController.php @@ -28,7 +28,7 @@ class ForgotPasswordController extends Controller protected function validateEmail(Request $request): void { - if (! config('captcha.enabled')) { + if (!config('captcha.enabled')) { $request->validate(['email' => 'required|email']); } else { $request->validate([ diff --git a/app/Http/Controllers/Auth/ForgotUsernameController.php b/app/Http/Controllers/Auth/ForgotUsernameController.php index 8324d87c9..8bda01794 100644 --- a/app/Http/Controllers/Auth/ForgotUsernameController.php +++ b/app/Http/Controllers/Auth/ForgotUsernameController.php @@ -38,7 +38,7 @@ class ForgotUsernameController extends Controller { $email = $request->get('email'); - if (! config('captcha.enabled')) { + if (!config('captcha.enabled')) { $v = validator($request->all(), [ 'email' => 'required', ]); diff --git a/app/Http/Controllers/Auth/RegisterController.php b/app/Http/Controllers/Auth/RegisterController.php index 16865fc2a..bef53786d 100644 --- a/app/Http/Controllers/Auth/RegisterController.php +++ b/app/Http/Controllers/Auth/RegisterController.php @@ -64,7 +64,7 @@ class RegisterController extends Controller // Make sure open reg is off and invite code exist and has not been used already $key = Invite::where('code', '=', $code)->first(); - if (config('other.invite-only') == 1 && (! $key || $key->accepted_by !== null)) { + if (config('other.invite-only') == 1 && (!$key || $key->accepted_by !== null)) { return to_route('registrationForm', ['code' => $code]) ->withErrors(trans('auth.invalid-key')); } @@ -84,7 +84,7 @@ class RegisterController extends Controller $user->group_id = $validatingGroup[0]; if (config('email-blacklist.enabled')) { - if (! config('captcha.enabled')) { + if (!config('captcha.enabled')) { $v = validator($request->all(), [ 'username' => 'required|alpha_dash|string|between:3,25|unique:users', 'password' => [ @@ -118,7 +118,7 @@ class RegisterController extends Controller 'captcha' => 'hiddencaptcha', ]); } - } elseif (! config('captcha.enabled')) { + } elseif (!config('captcha.enabled')) { $v = validator($request->all(), [ 'username' => 'required|alpha_dash|string|between:3,25|unique:users', 'password' => [ diff --git a/app/Http/Controllers/ForumCategoryController.php b/app/Http/Controllers/ForumCategoryController.php index f442aa64f..55ef466e7 100644 --- a/app/Http/Controllers/ForumCategoryController.php +++ b/app/Http/Controllers/ForumCategoryController.php @@ -34,7 +34,7 @@ class ForumCategoryController extends Controller } // Check if the user has permission to view the forum - if (! $forum->getPermission()->show_forum) { + if (!$forum->getPermission()->show_forum) { return to_route('forums.index') ->withErrors('You Do Not Have Access To This Category!'); } diff --git a/app/Http/Controllers/ForumController.php b/app/Http/Controllers/ForumController.php index b03af2e11..5e3d38304 100644 --- a/app/Http/Controllers/ForumController.php +++ b/app/Http/Controllers/ForumController.php @@ -59,7 +59,7 @@ class ForumController extends Controller } // Check if the user has permission to view the forum - if (! $forum->getPermission()->show_forum) { + if (!$forum->getPermission()->show_forum) { return to_route('forums.index') ->withErrors('You Do Not Have Access To This Forum!'); } diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 39daf8871..feb2b3b18 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -70,7 +70,7 @@ class HomeController extends Controller ->where('last_action', '>', now()->subMinutes(5)) ->orderByRaw('(select position from `groups` where `groups`.id = users.group_id), group_id, username') ->get() - ->sortBy(fn ($user) => $user->hidden || ! $user->isVisible($user, 'other', 'show_online')) + ->sortBy(fn ($user) => $user->hidden || !$user->isVisible($user, 'other', 'show_online')) ), 'groups' => cache()->remember( 'user-groups', diff --git a/app/Http/Controllers/PlaylistController.php b/app/Http/Controllers/PlaylistController.php index 90036939b..5491ab65f 100644 --- a/app/Http/Controllers/PlaylistController.php +++ b/app/Http/Controllers/PlaylistController.php @@ -83,7 +83,7 @@ class PlaylistController extends Controller ] + $request->validated()); // Announce To Shoutbox - if (! $playlist->is_private) { + if (!$playlist->is_private) { $this->chatRepository->systemMessage( sprintf('User [url=%s/', config('app.url')).$request->user()->username.'.'.$request->user()->id.']'.$request->user()->username.sprintf('[/url] has created a new playlist [url=%s/playlists/', config('app.url')).$playlist->id.']'.$playlist->name.'[/url] check it out now! :slight_smile:' ); diff --git a/app/Http/Controllers/PlaylistZipController.php b/app/Http/Controllers/PlaylistZipController.php index c1d59fd8b..37cdfa460 100644 --- a/app/Http/Controllers/PlaylistZipController.php +++ b/app/Http/Controllers/PlaylistZipController.php @@ -41,7 +41,7 @@ class PlaylistZipController extends Controller $path = getcwd().'/files/tmp_zip/'; // Check Directory exists - if (! File::isDirectory($path)) { + if (!File::isDirectory($path)) { File::makeDirectory($path, 0755, true, true); } diff --git a/app/Http/Controllers/PostController.php b/app/Http/Controllers/PostController.php index acde47e57..2f8a6dc38 100644 --- a/app/Http/Controllers/PostController.php +++ b/app/Http/Controllers/PostController.php @@ -70,7 +70,7 @@ class PostController extends Controller ['reply_topic', '=', 1], ['group_id', '=', $user->group_id] ]) - ->when(! $user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) + ->when(!$user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) ->findOrFail($request->topic_id); $forum = $topic->forum; @@ -157,7 +157,7 @@ class PostController extends Controller ['reply_topic', '=', 1], ['group_id', '=', $user->group_id], ]) - ->when(! $user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) + ->when(!$user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) ->sole(); abort_unless($user->group->is_modo || $user->id === $post->user_id, 403); @@ -195,7 +195,7 @@ class PostController extends Controller ['reply_topic', '=', 1], ['group_id', '=', $user->group_id], ]) - ->when(! $user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) + ->when(!$user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) ->exists(), 403 ); diff --git a/app/Http/Controllers/RssController.php b/app/Http/Controllers/RssController.php index 330990adb..ffb5cf138 100644 --- a/app/Http/Controllers/RssController.php +++ b/app/Http/Controllers/RssController.php @@ -133,7 +133,7 @@ class RssController extends Controller $bannedGroup = cache()->rememberForever('banned_group', fn () => Group::where('slug', '=', 'banned')->pluck('id')); $disabledGroup = cache()->rememberForever('disabled_group', fn () => Group::where('slug', '=', 'disabled')->pluck('id')); - abort_if($user->group_id == $bannedGroup[0] || $user->group_id == $disabledGroup[0] || ! $user->active, 404); + abort_if($user->group_id == $bannedGroup[0] || $user->group_id == $disabledGroup[0] || !$user->active, 404); $rss = Rss::query() ->where( diff --git a/app/Http/Controllers/SimilarTorrentController.php b/app/Http/Controllers/SimilarTorrentController.php index ccc101aae..354b38aeb 100644 --- a/app/Http/Controllers/SimilarTorrentController.php +++ b/app/Http/Controllers/SimilarTorrentController.php @@ -118,7 +118,7 @@ class SimilarTorrentController extends Controller /** @var Carbon $lastUpdated */ $lastUpdated = cache()->get($cacheKey); - abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && ! $request->user()->group->is_modo, 403); + abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && !$request->user()->group->is_modo, 403); cache()->put($cacheKey, now(), now()->addDay()); @@ -131,7 +131,7 @@ class SimilarTorrentController extends Controller /** @var Carbon $lastUpdated */ $lastUpdated = cache()->get($cacheKey); - abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && ! $request->user()->group->is_modo, 403); + abort_if($lastUpdated !== null && $lastUpdated->addDay()->isFuture() && !$request->user()->group->is_modo, 403); cache()->put($cacheKey, now(), now()->addDay()); diff --git a/app/Http/Controllers/Staff/UserController.php b/app/Http/Controllers/Staff/UserController.php index 43e711402..5d2c6aba3 100644 --- a/app/Http/Controllers/Staff/UserController.php +++ b/app/Http/Controllers/Staff/UserController.php @@ -58,7 +58,7 @@ class UserController extends Controller return view('Staff.user.edit', [ 'user' => $user, - 'groups' => Group::when(! $group->is_owner, fn ($query) => $query->where('level', '<=', $group->level))->get(), + 'groups' => Group::when(!$group->is_owner, fn ($query) => $query->where('level', '<=', $group->level))->get(), 'internals' => Internal::all(), ]); } @@ -72,7 +72,7 @@ class UserController extends Controller $staff = $request->user(); $group = Group::findOrFail($request->group_id); - abort_if(! ($staff->group->is_owner || $staff->group->is_admin) && ($staff->group->level <= $user->group->level || $staff->group->level <= $group->level), 403); + abort_if(!($staff->group->is_owner || $staff->group->is_admin) && ($staff->group->level <= $user->group->level || $staff->group->level <= $group->level), 403); $user->update($request->validated()); diff --git a/app/Http/Controllers/Staff/VersionController.php b/app/Http/Controllers/Staff/VersionController.php index 55eec2db0..27fb6167f 100644 --- a/app/Http/Controllers/Staff/VersionController.php +++ b/app/Http/Controllers/Staff/VersionController.php @@ -29,7 +29,7 @@ class VersionController extends Controller $latestVersion = Http::get('//api.github.com/repos/HDInnovations/UNIT3D/releases')[0]['tag_name']; return response([ - 'updated' => ! version_compare(config('unit3d.version'), $latestVersion, '<'), + 'updated' => !version_compare(config('unit3d.version'), $latestVersion, '<'), 'latestversion' => $latestVersion, ]); } diff --git a/app/Http/Controllers/SubtitleController.php b/app/Http/Controllers/SubtitleController.php index 2ae9cd768..5f4b17dea 100644 --- a/app/Http/Controllers/SubtitleController.php +++ b/app/Http/Controllers/SubtitleController.php @@ -92,7 +92,7 @@ class SubtitleController extends Controller Storage::disk('subtitles')->put($filename, file_get_contents($subtitleFile)); // Announce To Shoutbox - if (! $subtitle->anon) { + if (!$subtitle->anon) { $this->chatRepository->systemMessage( sprintf( '[url=%s]%s[/url] has uploaded a new %s subtitle for [url=%s]%s[/url]', diff --git a/app/Http/Controllers/TopicController.php b/app/Http/Controllers/TopicController.php index dda07bca4..d6a86b31a 100644 --- a/app/Http/Controllers/TopicController.php +++ b/app/Http/Controllers/TopicController.php @@ -191,7 +191,7 @@ class TopicController extends Controller ['read_topic', '=', 1], ['group_id', '=', $user->group_id] ]) - ->when(! $user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) + ->when(!$user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) ->findOrFail($id); abort_unless($user->group->is_modo || $user->id === $topic->first_post_user_id, 403); @@ -228,7 +228,7 @@ class TopicController extends Controller ]); $topic = Topic::query() - ->when(! $user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) + ->when(!$user->group->is_modo, fn ($query) => $query->where('state', '=', 'open')) ->findOrFail($id); abort_unless($user->group->is_modo || $user->id === $topic->first_post_user_id, 403); diff --git a/app/Http/Controllers/TopicLabelController.php b/app/Http/Controllers/TopicLabelController.php index 98e58faad..9590aaff7 100644 --- a/app/Http/Controllers/TopicLabelController.php +++ b/app/Http/Controllers/TopicLabelController.php @@ -26,7 +26,7 @@ class TopicLabelController extends Controller public function approve(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->approved = ! $topic->approved; + $topic->approved = !$topic->approved; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -39,7 +39,7 @@ class TopicLabelController extends Controller public function deny(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->denied = ! $topic->denied; + $topic->denied = !$topic->denied; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -52,7 +52,7 @@ class TopicLabelController extends Controller public function solve(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->solved = ! $topic->solved; + $topic->solved = !$topic->solved; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -65,7 +65,7 @@ class TopicLabelController extends Controller public function invalid(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->invalid = ! $topic->invalid; + $topic->invalid = !$topic->invalid; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -78,7 +78,7 @@ class TopicLabelController extends Controller public function bug(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->bug = ! $topic->bug; + $topic->bug = !$topic->bug; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -91,7 +91,7 @@ class TopicLabelController extends Controller public function suggest(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->suggestion = ! $topic->suggestion; + $topic->suggestion = !$topic->suggestion; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) @@ -104,7 +104,7 @@ class TopicLabelController extends Controller public function implement(int $id): \Illuminate\Http\RedirectResponse { $topic = Topic::findOrFail($id); - $topic->implemented = ! $topic->implemented; + $topic->implemented = !$topic->implemented; $topic->save(); return to_route('topics.show', ['id' => $topic->id]) diff --git a/app/Http/Controllers/TorrentBuffController.php b/app/Http/Controllers/TorrentBuffController.php index 5bbcd3796..34930d1cf 100644 --- a/app/Http/Controllers/TorrentBuffController.php +++ b/app/Http/Controllers/TorrentBuffController.php @@ -77,7 +77,7 @@ class TorrentBuffController extends Controller abort_unless($user->group->is_modo || $user->group->is_internal, 403); $torrent = Torrent::withoutGlobalScope(ApprovedScope::class)->findOrFail($id); - $torrent->sticky = ! $torrent->sticky; + $torrent->sticky = !$torrent->sticky; $torrent->save(); return to_route('torrents.show', ['id' => $torrent->id]) @@ -211,7 +211,7 @@ class TorrentBuffController extends Controller $torrent = Torrent::withoutGlobalScope(ApprovedScope::class)->findOrFail($id); $torrentUrl = href_torrent($torrent); - if (! $torrent->doubleup) { + if (!$torrent->doubleup) { $torrent->doubleup = true; $du_until = $request->input('du_until'); @@ -252,7 +252,7 @@ class TorrentBuffController extends Controller $activeToken = cache()->get('freeleech_token:'.$user->id.':'.$torrent->id); - if ($user->fl_tokens >= 1 && ! $activeToken) { + if ($user->fl_tokens >= 1 && !$activeToken) { $freeleechToken = new FreeleechToken(); $freeleechToken->user_id = $user->id; $freeleechToken->torrent_id = $torrent->id; @@ -284,7 +284,7 @@ class TorrentBuffController extends Controller $torrent = Torrent::withoutGlobalScope(ApprovedScope::class)->findOrFail($id); $torrent_url = href_torrent($torrent); - if (! $torrent->refundable) { + if (!$torrent->refundable) { $torrent->refundable = true; $this->chatRepository->systemMessage( diff --git a/app/Http/Controllers/TorrentController.php b/app/Http/Controllers/TorrentController.php index 312a18202..7aa5fb453 100644 --- a/app/Http/Controllers/TorrentController.php +++ b/app/Http/Controllers/TorrentController.php @@ -435,7 +435,7 @@ class TorrentController extends Controller } // check for trusted user and update torrent - if ($user->group->is_trusted && ! $request->boolean('mod_queue_opt_in')) { + if ($user->group->is_trusted && !$request->boolean('mod_queue_opt_in')) { $appurl = config('app.url'); $user = $torrent->user; $username = $user->username; diff --git a/app/Http/Controllers/TorrentDownloadController.php b/app/Http/Controllers/TorrentDownloadController.php index 0a06f071d..01efd9584 100644 --- a/app/Http/Controllers/TorrentDownloadController.php +++ b/app/Http/Controllers/TorrentDownloadController.php @@ -40,20 +40,20 @@ class TorrentDownloadController extends Controller { $user = $request->user(); - if (! $user && $rsskey) { + if (!$user && $rsskey) { $user = User::where('rsskey', '=', $rsskey)->sole(); } $torrent = Torrent::withoutGlobalScope(ApprovedScope::class)->findOrFail($id); $hasHistory = $user->history()->where([['torrent_id', '=', $torrent->id], ['seeder', '=', 1]])->exists(); // User's ratio is too low - if ($user->ratio < config('other.ratio') && ! ($torrent->user_id === $user->id || $hasHistory)) { + if ($user->ratio < config('other.ratio') && !($torrent->user_id === $user->id || $hasHistory)) { return to_route('torrents.show', ['id' => $torrent->id]) ->withErrors('Your Ratio Is Too Low To Download!'); } // User's download rights are revoked - if ($user->can_download == 0 && ! ($torrent->user_id === $user->id || $hasHistory)) { + if ($user->can_download == 0 && !($torrent->user_id === $user->id || $hasHistory)) { return to_route('torrents.show', ['id' => $torrent->id]) ->withErrors('Your Download Rights Have Been Revoked!'); } @@ -65,12 +65,12 @@ class TorrentDownloadController extends Controller } // The torrent file exist ? - if (! file_exists(getcwd().'/files/torrents/'.$torrent->file_name)) { + if (!file_exists(getcwd().'/files/torrents/'.$torrent->file_name)) { return to_route('torrents.show', ['id' => $torrent->id]) ->withErrors('Torrent File Not Found! Please Report This Torrent!'); } - if (! $request->user() && !($rsskey && $user)) { + if (!$request->user() && !($rsskey && $user)) { return to_route('login'); } diff --git a/app/Http/Controllers/User/ApikeyController.php b/app/Http/Controllers/User/ApikeyController.php index 926cd8bed..1cdcecca6 100644 --- a/app/Http/Controllers/User/ApikeyController.php +++ b/app/Http/Controllers/User/ApikeyController.php @@ -30,7 +30,7 @@ class ApikeyController extends Controller $changedByStaff = $request->user()->isNot($user); - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); $user->update([ 'api_token' => Str::random(100), diff --git a/app/Http/Controllers/User/EmailController.php b/app/Http/Controllers/User/EmailController.php index c93ed20b4..7aee605db 100644 --- a/app/Http/Controllers/User/EmailController.php +++ b/app/Http/Controllers/User/EmailController.php @@ -31,7 +31,7 @@ class EmailController extends Controller $changedByStaff = $request->user()->isNot($user); - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); $request->validate([ 'email' => [ diff --git a/app/Http/Controllers/User/InviteController.php b/app/Http/Controllers/User/InviteController.php index e4178696f..230341a98 100644 --- a/app/Http/Controllers/User/InviteController.php +++ b/app/Http/Controllers/User/InviteController.php @@ -49,7 +49,7 @@ class InviteController extends Controller { abort_unless($request->user()->is($user), 403); - if (! config('other.invite-only')) { + if (!config('other.invite-only')) { return to_route('home.index') ->withErrors(trans('user.invites-disabled')); } @@ -59,7 +59,7 @@ class InviteController extends Controller ->withErrors(trans('user.invites-banned')); } - if (config('other.invites_restriced') && ! \in_array($user->group->name, config('other.invite_groups'), true)) { + if (config('other.invites_restriced') && !\in_array($user->group->name, config('other.invite_groups'), true)) { return to_route('home.index') ->withErrors(trans('user.invites-disabled-group')); } @@ -76,7 +76,7 @@ class InviteController extends Controller { abort_unless($request->user()->is($user) && $user->can_invite, 403); - if (config('other.invites_restriced') && ! \in_array($user->group->name, config('other.invite_groups'), true)) { + if (config('other.invites_restriced') && !\in_array($user->group->name, config('other.invite_groups'), true)) { return to_route('home.index') ->withErrors(trans('user.invites-disabled-group')); } diff --git a/app/Http/Controllers/User/PasskeyController.php b/app/Http/Controllers/User/PasskeyController.php index 08b8bc689..8b54a465e 100644 --- a/app/Http/Controllers/User/PasskeyController.php +++ b/app/Http/Controllers/User/PasskeyController.php @@ -30,7 +30,7 @@ class PasskeyController extends Controller $changedByStaff = $request->user()->isNot($user); - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); $user->update([ 'passkey' => md5(random_bytes(60).$user->password) diff --git a/app/Http/Controllers/User/PasswordController.php b/app/Http/Controllers/User/PasswordController.php index c9c355a3d..f83851c47 100644 --- a/app/Http/Controllers/User/PasswordController.php +++ b/app/Http/Controllers/User/PasswordController.php @@ -32,10 +32,10 @@ class PasswordController extends Controller $changedByStaff = $request->user()->isNot($user); - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); $request->validate([ - 'current_password' => Rule::when(! $changedByStaff, [ + 'current_password' => Rule::when(!$changedByStaff, [ 'required', 'current_password', ]), diff --git a/app/Http/Controllers/User/RsskeyController.php b/app/Http/Controllers/User/RsskeyController.php index 7d40ea8b5..e023ded2b 100644 --- a/app/Http/Controllers/User/RsskeyController.php +++ b/app/Http/Controllers/User/RsskeyController.php @@ -29,7 +29,7 @@ class RsskeyController extends Controller $changedByStaff = $request->user()->isNot($user); - abort_if($changedByStaff && ! $request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); + abort_if($changedByStaff && !$request->user()->group->is_owner && $request->user()->group->level <= $user->group->level, 403); $user->update([ 'rsskey' => md5(random_bytes(60).$user->password), diff --git a/app/Http/Controllers/User/TorrentZipController.php b/app/Http/Controllers/User/TorrentZipController.php index 2b985f5ba..c95e8f5d3 100644 --- a/app/Http/Controllers/User/TorrentZipController.php +++ b/app/Http/Controllers/User/TorrentZipController.php @@ -38,7 +38,7 @@ class TorrentZipController extends Controller $zipPath = getcwd().'/files/tmp_zip/'; // Check Directory exists - if (! File::isDirectory($zipPath)) { + if (!File::isDirectory($zipPath)) { File::makeDirectory($zipPath, 0755, true, true); } diff --git a/app/Http/Controllers/User/UserController.php b/app/Http/Controllers/User/UserController.php index 326934899..ac379df57 100644 --- a/app/Http/Controllers/User/UserController.php +++ b/app/Http/Controllers/User/UserController.php @@ -128,12 +128,12 @@ class UserController extends Controller if ($request->hasFile('image') && $request->file('image')->getError() === 0) { $image = $request->file('image'); - if (! \in_array($image->getClientOriginalExtension(), ['jpg', 'JPG', 'jpeg', 'bmp', 'png', 'PNG', 'tiff', 'gif'])) { + if (!\in_array($image->getClientOriginalExtension(), ['jpg', 'JPG', 'jpeg', 'bmp', 'png', 'PNG', 'tiff', 'gif'])) { return to_route('users.show', ['user' => $user]) ->withErrors('Only .jpg, .bmp, .png, .tiff, and .gif are allowed.'); } - if (! preg_match('#image/*#', (string) $image->getMimeType())) { + if (!preg_match('#image/*#', (string) $image->getMimeType())) { return to_route('users.show', ['user' => $user]) ->withErrors('Incorrect mime type.'); } diff --git a/app/Http/Livewire/BackupPanel.php b/app/Http/Livewire/BackupPanel.php index d4c5f80aa..d3e218b71 100644 --- a/app/Http/Livewire/BackupPanel.php +++ b/app/Http/Livewire/BackupPanel.php @@ -119,7 +119,7 @@ class BackupPanel extends Component $backup = $backupDestination->backups()->first(fn (Backup $backup) => $backup->path() === $filePath); - if (! $backup) { + if (!$backup) { return response('Backup not found', ResponseAlias::HTTP_UNPROCESSABLE_ENTITY); } diff --git a/app/Http/Livewire/Comment.php b/app/Http/Livewire/Comment.php index 5f95dd7cb..1582797c6 100644 --- a/app/Http/Livewire/Comment.php +++ b/app/Http/Livewire/Comment.php @@ -82,7 +82,7 @@ class Comment extends Component final public function updatedIsEditing($isEditing): void { - if (! $isEditing) { + if (!$isEditing) { return; } @@ -119,7 +119,7 @@ class Comment extends Component return; } - if (! $this->comment->isParent()) { + if (!$this->comment->isParent()) { return; } @@ -149,7 +149,7 @@ class Comment extends Component User::find($ticket->user_id)->notify(new NewComment($modelName, $reply)); } - if (! \in_array($this->comment->user_id, [$ticket->staff_id, $ticket->user_id, $this->user->id])) { + if (!\in_array($this->comment->user_id, [$ticket->staff_id, $ticket->user_id, $this->user->id])) { User::find($this->comment->user_id)->notify(new NewComment($modelName, $reply)); } diff --git a/app/Http/Livewire/SimilarTorrent.php b/app/Http/Livewire/SimilarTorrent.php index 1f1202589..c406e5117 100644 --- a/app/Http/Livewire/SimilarTorrent.php +++ b/app/Http/Livewire/SimilarTorrent.php @@ -162,7 +162,7 @@ class SimilarTorrent extends Component $names[] = $torrent->name; foreach (History::where('torrent_id', '=', $torrent->id)->get() as $pm) { - if (! \in_array($pm->user_id, $users)) { + if (!\in_array($pm->user_id, $users)) { $users[] = $pm->user_id; } } diff --git a/app/Http/Livewire/SubtitleSearch.php b/app/Http/Livewire/SubtitleSearch.php index 18c6deba6..07502f96b 100644 --- a/app/Http/Livewire/SubtitleSearch.php +++ b/app/Http/Livewire/SubtitleSearch.php @@ -62,7 +62,7 @@ class SubtitleSearch extends Component fn ($query) => $query ->whereIn('user_id', User::select('id')->where('username', '=', $this->username)) ->when( - ! auth()->user()->group->is_modo, + !auth()->user()->group->is_modo, fn ($query) => $query->where(fn ($query) => $query->where('anon', '=', false)->orWhere('user_id', '=', auth()->id())) ) ) diff --git a/app/Http/Livewire/TicketSearch.php b/app/Http/Livewire/TicketSearch.php index e84fb1109..8786911bc 100644 --- a/app/Http/Livewire/TicketSearch.php +++ b/app/Http/Livewire/TicketSearch.php @@ -66,7 +66,7 @@ class TicketSearch extends Component { return Ticket::query() ->with(['user.group', 'staff.group', 'category', 'priority']) - ->when(! $this->user->group->is_modo, fn ($query) => $query->where('user_id', '=', $this->user->id)) + ->when(!$this->user->group->is_modo, fn ($query) => $query->where('user_id', '=', $this->user->id)) ->when( $this->tab === 'open', fn ($query) => $query->whereNull('closed_at'), diff --git a/app/Http/Livewire/TorrentRequestSearch.php b/app/Http/Livewire/TorrentRequestSearch.php index 1cbd8f7e8..f55f2756f 100644 --- a/app/Http/Livewire/TorrentRequestSearch.php +++ b/app/Http/Livewire/TorrentRequestSearch.php @@ -99,7 +99,7 @@ class TorrentRequestSearch extends Component final public function toggleShowFilters(): void { - $this->showFilters = ! $this->showFilters; + $this->showFilters = !$this->showFilters; } final public function getTorrentRequestStatProperty(): ?object diff --git a/app/Http/Livewire/TorrentSearch.php b/app/Http/Livewire/TorrentSearch.php index 638f35887..c8298fc42 100644 --- a/app/Http/Livewire/TorrentSearch.php +++ b/app/Http/Livewire/TorrentSearch.php @@ -252,7 +252,7 @@ class TorrentSearch extends Component $user = auth()->user(); // Whitelist which columns are allowed to be ordered by - if (! \in_array($this->sortField, [ + if (!\in_array($this->sortField, [ 'name', 'size', 'seeders', @@ -332,7 +332,7 @@ class TorrentSearch extends Component $user = auth()->user(); // Whitelist which columns are allowed to be ordered by - if (! \in_array($this->sortField, [ + if (!\in_array($this->sortField, [ 'bumped_at', 'times_completed', ])) { @@ -570,7 +570,7 @@ class TorrentSearch extends Component final public function getGroupedPostersProperty() { // Whitelist which columns are allowed to be ordered by - if (! \in_array($this->sortField, [ + if (!\in_array($this->sortField, [ 'bumped_at', 'times_completed', ])) { diff --git a/app/Http/Livewire/UserSearch.php b/app/Http/Livewire/UserSearch.php index 83176d94f..aa755c097 100644 --- a/app/Http/Livewire/UserSearch.php +++ b/app/Http/Livewire/UserSearch.php @@ -56,7 +56,7 @@ class UserSearch extends Component final public function toggleProperties($property): void { if ($property === 'show') { - $this->show = ! $this->show; + $this->show = !$this->show; } } diff --git a/app/Http/Livewire/UserTorrents.php b/app/Http/Livewire/UserTorrents.php index a79329d9e..64121235c 100644 --- a/app/Http/Livewire/UserTorrents.php +++ b/app/Http/Livewire/UserTorrents.php @@ -158,7 +158,7 @@ class UserTorrents extends Component ->when($this->uploaded === 'exclude', fn ($query) => $query->where('torrents.user_id', '<>', $this->user->id)) ->when($this->downloaded === 'include', fn ($query) => $query->where('history.actual_downloaded', '>', 0)) ->when($this->downloaded === 'exclude', fn ($query) => $query->where('history.actual_downloaded', '=', 0)) - ->when(! empty($this->status), fn ($query) => $query->whereIntegerInRaw('status', $this->status)) + ->when(!empty($this->status), fn ($query) => $query->whereIntegerInRaw('status', $this->status)) ->orderBy($this->sortField, $this->sortDirection) ->paginate($this->perPage); } diff --git a/app/Http/Livewire/UserUploads.php b/app/Http/Livewire/UserUploads.php index 69e43e49f..9181e1bad 100644 --- a/app/Http/Livewire/UserUploads.php +++ b/app/Http/Livewire/UserUploads.php @@ -76,7 +76,7 @@ class UserUploads extends Component fn ($query) => $query ->where('name', 'like', '%'.str_replace(' ', '%', $this->name).'%') ) - ->when(! empty($this->status), fn ($query) => $query->whereIntegerInRaw('status', $this->status)) + ->when(!empty($this->status), fn ($query) => $query->whereIntegerInRaw('status', $this->status)) ->when($this->personalRelease === 'include', fn ($query) => $query->where('personal_release', '=', 1)) ->when($this->personalRelease === 'exclude', fn ($query) => $query->where('personal_release', '=', 0)) ->orderBy($this->sortField, $this->sortDirection) diff --git a/app/Http/Livewire/WarningLogSearch.php b/app/Http/Livewire/WarningLogSearch.php index ea1647004..48649cb93 100644 --- a/app/Http/Livewire/WarningLogSearch.php +++ b/app/Http/Livewire/WarningLogSearch.php @@ -57,7 +57,7 @@ class WarningLogSearch extends Component final public function toggleProperties($property): void { if ($property === 'show') { - $this->show = ! $this->show; + $this->show = !$this->show; } } diff --git a/app/Http/Middleware/SetLanguage.php b/app/Http/Middleware/SetLanguage.php index 73d4dffc8..b408ffed4 100644 --- a/app/Http/Middleware/SetLanguage.php +++ b/app/Http/Middleware/SetLanguage.php @@ -27,7 +27,7 @@ class SetLanguage private function setLocale(string $locale): void { // Check if is allowed and set default locale if not - if (! Language::allowed($locale)) { + if (!Language::allowed($locale)) { $locale = config('app.locale'); } diff --git a/app/Http/Requests/StorePollVoteRequest.php b/app/Http/Requests/StorePollVoteRequest.php index e561406e7..923c02195 100644 --- a/app/Http/Requests/StorePollVoteRequest.php +++ b/app/Http/Requests/StorePollVoteRequest.php @@ -45,7 +45,7 @@ class StorePollVoteRequest extends FormRequest 'options' => [ 'required', 'array', - Rule::when(! $poll->multiple_choice, 'max:1'), + Rule::when(!$poll->multiple_choice, 'max:1'), 'min:1', ], 'options.*' => [ diff --git a/app/Http/Requests/StoreSubtitleRequest.php b/app/Http/Requests/StoreSubtitleRequest.php index 55f0ddcab..f7750359f 100644 --- a/app/Http/Requests/StoreSubtitleRequest.php +++ b/app/Http/Requests/StoreSubtitleRequest.php @@ -39,7 +39,7 @@ class StoreSubtitleRequest extends FormRequest 'required', 'file', function (string $attribute, mixed $value, Closure $fail): void { - if (! \in_array('.'.$value->getClientOriginalExtension(), ['.srt','.ass', '.sup', '.zip'])) { + if (!\in_array('.'.$value->getClientOriginalExtension(), ['.srt','.ass', '.sup', '.zip'])) { $fail('The Subtitle uploaded does not have a ".srt, .ass, .sup or .zip" file extension (it has "'.$value->getClientOriginalExtension().'"). Did you upload the correct file?'); } }, diff --git a/app/Http/Requests/StoreTorrentRequest.php b/app/Http/Requests/StoreTorrentRequest.php index c480cb98c..6c0efa648 100644 --- a/app/Http/Requests/StoreTorrentRequest.php +++ b/app/Http/Requests/StoreTorrentRequest.php @@ -67,7 +67,7 @@ class StoreTorrentRequest extends FormRequest } foreach (TorrentTools::getFilenameArray($decodedTorrent) as $name) { - if (! TorrentTools::isValidFilename($name)) { + if (!TorrentTools::isValidFilename($name)) { $fail('Invalid Filenames In Torrent Files!'); } } @@ -124,7 +124,7 @@ class StoreTorrentRequest extends FormRequest ], 'resolution_id' => [ Rule::when($category->movie_meta || $category->tv_meta, 'required'), - Rule::when(! $category->movie_meta && ! $category->tv_meta, 'nullable'), + Rule::when(!$category->movie_meta && !$category->tv_meta, 'nullable'), 'exists:resolutions,id', ], 'region_id' => [ @@ -140,7 +140,7 @@ class StoreTorrentRequest extends FormRequest 'required', 'numeric', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -150,7 +150,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! $category->tv_meta, [ + Rule::when(!$category->tv_meta, [ Rule::in([0]), ]), ], @@ -160,7 +160,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -170,7 +170,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -180,7 +180,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! $category->game_meta, [ + Rule::when(!$category->game_meta, [ Rule::in([0]), ]), ], @@ -190,7 +190,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::prohibitedIf(! $category->tv_meta), + Rule::prohibitedIf(!$category->tv_meta), ], 'episode_number' => [ Rule::when($category->tv_meta, [ @@ -198,7 +198,7 @@ class StoreTorrentRequest extends FormRequest 'numeric', 'integer', ]), - Rule::prohibitedIf(! $category->tv_meta), + Rule::prohibitedIf(!$category->tv_meta), ], 'anon' => [ 'required', @@ -219,19 +219,19 @@ class StoreTorrentRequest extends FormRequest 'internal' => [ 'sometimes', 'boolean', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], 'free' => [ 'sometimes', 'integer', 'numeric', 'between:0,100', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], 'refundable' => [ 'sometimes', 'boolean', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], ]; } diff --git a/app/Http/Requests/StoreTorrentRequestRequest.php b/app/Http/Requests/StoreTorrentRequestRequest.php index 81d50b90e..2a25534f4 100644 --- a/app/Http/Requests/StoreTorrentRequestRequest.php +++ b/app/Http/Requests/StoreTorrentRequestRequest.php @@ -47,7 +47,7 @@ class StoreTorrentRequestRequest extends FormRequest 'required', 'numeric', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -57,7 +57,7 @@ class StoreTorrentRequestRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! $category->tv_meta, [ + Rule::when(!$category->tv_meta, [ Rule::in([0]), ]), ], @@ -67,7 +67,7 @@ class StoreTorrentRequestRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -77,7 +77,7 @@ class StoreTorrentRequestRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! ($category->movie_meta || $category->tv_meta), [ + Rule::when(!($category->movie_meta || $category->tv_meta), [ Rule::in([0]), ]), ], @@ -87,7 +87,7 @@ class StoreTorrentRequestRequest extends FormRequest 'numeric', 'integer', ]), - Rule::when(! $category->game_meta, [ + Rule::when(!$category->game_meta, [ Rule::in([0]), ]), ], diff --git a/app/Http/Requests/UpdateTorrentRequest.php b/app/Http/Requests/UpdateTorrentRequest.php index d6cf42505..e932d3b4a 100644 --- a/app/Http/Requests/UpdateTorrentRequest.php +++ b/app/Http/Requests/UpdateTorrentRequest.php @@ -69,7 +69,7 @@ class UpdateTorrentRequest extends FormRequest ], 'resolution_id' => [ Rule::when($category->movie_meta || $category->tv_meta, 'required'), - Rule::when(! $category->movie_meta && ! $category->tv_meta, 'nullable'), + Rule::when(!$category->movie_meta && !$category->tv_meta, 'nullable'), 'exists:resolutions,id', ], 'region_id' => [ @@ -102,18 +102,18 @@ class UpdateTorrentRequest extends FormRequest ], 'season_number' => [ Rule::when($category->tv_meta, 'required'), - Rule::when(! $category->tv_meta, 'nullable'), + Rule::when(!$category->tv_meta, 'nullable'), 'numeric', ], 'episode_number' => [ Rule::when($category->tv_meta, 'required'), - Rule::when(! $category->tv_meta, 'nullable'), + Rule::when(!$category->tv_meta, 'nullable'), 'numeric', ], 'anon' => [ 'required', 'boolean', - Rule::when(Torrent::withoutGlobalScope(ApprovedScope::class)->find($request->route('id'))->user_id !== $request->user()->id && ! $request->user()->group->is_modo, 'exclude'), + Rule::when(Torrent::withoutGlobalScope(ApprovedScope::class)->find($request->route('id'))->user_id !== $request->user()->id && !$request->user()->group->is_modo, 'exclude'), ], 'stream' => [ 'required', @@ -130,17 +130,17 @@ class UpdateTorrentRequest extends FormRequest 'internal' => [ 'sometimes', 'boolean', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], 'free' => [ 'sometimes', 'between:0,100', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], 'refundable' => [ 'sometimes', 'boolean', - Rule::when(! $request->user()->group->is_modo && ! $request->user()->group->is_internal, 'prohibited'), + Rule::when(!$request->user()->group->is_modo && !$request->user()->group->is_internal, 'prohibited'), ], ]; } diff --git a/app/Jobs/ProcessBackup.php b/app/Jobs/ProcessBackup.php index 8e3b3673d..10f91254b 100644 --- a/app/Jobs/ProcessBackup.php +++ b/app/Jobs/ProcessBackup.php @@ -43,7 +43,7 @@ class ProcessBackup implements ShouldQueue $backupJob->dontBackupDatabases(); } - if (! empty($this->option)) { + if (!empty($this->option)) { $prefix = str_replace('_', '-', (string) $this->option).'-'; $backupJob->setFilename($prefix.date('Y-m-d-H-i-s').'.zip'); diff --git a/app/Models/Comment.php b/app/Models/Comment.php index 3fdc960f5..1f244b224 100644 --- a/app/Models/Comment.php +++ b/app/Models/Comment.php @@ -100,7 +100,7 @@ class Comment extends Model if (empty($ticket->reminded_at) || strtotime((string) $ticket->reminded_at) < strtotime('+ 3 days')) { $last_comment = $ticket->comments()->latest('id')->first(); - if (property_exists($last_comment, 'id') && $last_comment->id !== null && ! $last_comment->user->group->is_modo && strtotime((string) $last_comment->created_at) < strtotime('- 3 days')) { + if (property_exists($last_comment, 'id') && $last_comment->id !== null && !$last_comment->user->group->is_modo && strtotime((string) $last_comment->created_at) < strtotime('- 3 days')) { event(new TicketWentStale($last_comment->commentable)); } } diff --git a/app/Models/User.php b/app/Models/User.php index 82c8af0bd..ee814676e 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -779,12 +779,12 @@ class User extends Authenticatable return false; } - if ($target->notification && $type && (! $target->notification->$type)) { + if ($target->notification && $type && (!$target->notification->$type)) { return false; } if (\is_array($target->notification?->$targetGroup)) { - return ! \in_array($sender->group->id, $target->notification->$targetGroup, true); + return !\in_array($sender->group->id, $target->notification->$targetGroup, true); } return true; @@ -810,12 +810,12 @@ class User extends Authenticatable return false; } - if ($target->privacy && $type && (! $target->privacy->$type || $target->privacy->$type == 0)) { + if ($target->privacy && $type && (!$target->privacy->$type || $target->privacy->$type == 0)) { return false; } if (\is_array($target->privacy?->$targetGroup)) { - return ! \in_array($sender->group->id, $target->privacy->$targetGroup); + return !\in_array($sender->group->id, $target->privacy->$targetGroup); } return true; @@ -841,12 +841,12 @@ class User extends Authenticatable return false; } - if ($target->privacy && $type && (! $target->privacy->$type || $target->privacy->$type == 0)) { + if ($target->privacy && $type && (!$target->privacy->$type || $target->privacy->$type == 0)) { return false; } if (\is_array($target->privacy?->$targetGroup)) { - return ! \in_array($sender->group->id, $target->privacy->$targetGroup); + return !\in_array($sender->group->id, $target->privacy->$targetGroup); } return true; diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index d9fb39fca..17887f2aa 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -70,7 +70,7 @@ class AppServiceProvider extends ServiceProvider $minLimit = (isset($parameters[0]) && is_numeric($parameters[0])) ? $parameters[0] : 0; $maxLimit = (isset($parameters[1]) && is_numeric($parameters[1])) ? $parameters[1] : 1_200; - if (! HiddenCaptcha::check($validator, $minLimit, $maxLimit)) { + if (!HiddenCaptcha::check($validator, $minLimit, $maxLimit)) { $validator->setCustomMessages(['hiddencaptcha' => 'Captcha error']); return false; diff --git a/app/Providers/CacheUserProvider.php b/app/Providers/CacheUserProvider.php index e9df9f5d3..fcb760bc4 100644 --- a/app/Providers/CacheUserProvider.php +++ b/app/Providers/CacheUserProvider.php @@ -34,7 +34,7 @@ class CacheUserProvider extends EloquentUserProvider { $model = CacheUser::user($identifier); - if (! $model) { + if (!$model) { return; } diff --git a/app/Rules/EmailBlacklist.php b/app/Rules/EmailBlacklist.php index 4a5b4b379..44ba3febd 100644 --- a/app/Rules/EmailBlacklist.php +++ b/app/Rules/EmailBlacklist.php @@ -26,7 +26,7 @@ class EmailBlacklist implements Rule $domain = Str::after(strtolower((string) $value), '@'); // Run validation check - return ! \in_array($domain, $this->domains, true); + return !\in_array($domain, $this->domains, true); } /** @@ -47,7 +47,7 @@ class EmailBlacklist implements Rule $autoupdate = config('email-blacklist.auto-update'); try { - if ($autoupdate && ! cache()->has(config('email-blacklist.cache-key'))) { + if ($autoupdate && !cache()->has(config('email-blacklist.cache-key'))) { EmailBlacklistUpdater::update(); } } catch (InvalidArgumentException) { diff --git a/app/Services/Tmdb/Client/Movie.php b/app/Services/Tmdb/Client/Movie.php index 07437a97c..962974ae6 100644 --- a/app/Services/Tmdb/Client/Movie.php +++ b/app/Services/Tmdb/Client/Movie.php @@ -181,7 +181,7 @@ class Movie public function get_trailer(): ?string { - if (! empty($this->data['videos']['results'])) { + if (!empty($this->data['videos']['results'])) { return 'https://www.youtube-nocookie.com/embed/'.$this->data['videos']['results'][0]['key']; } diff --git a/app/Services/Tmdb/Client/TV.php b/app/Services/Tmdb/Client/TV.php index b3d2e0bc0..a17839369 100644 --- a/app/Services/Tmdb/Client/TV.php +++ b/app/Services/Tmdb/Client/TV.php @@ -201,7 +201,7 @@ class TV public function get_trailer(): ?string { - if (! empty($this->data['videos']['results'])) { + if (!empty($this->data['videos']['results'])) { return 'https://www.youtube.com/embed/'.$this->data['videos']['results'][0]['key']; } diff --git a/app/Services/Tmdb/TMDB.php b/app/Services/Tmdb/TMDB.php index 194394293..9f3ef4e86 100644 --- a/app/Services/Tmdb/TMDB.php +++ b/app/Services/Tmdb/TMDB.php @@ -40,7 +40,7 @@ class TMDB public function ifExists($type, $array) { - if (isset($array[$type]) && ! empty($array[$type])) { + if (isset($array[$type]) && !empty($array[$type])) { return $array[$type]; } diff --git a/app/Services/Unit3dAnnounce.php b/app/Services/Unit3dAnnounce.php index 83d9899c3..86ae0d9dc 100644 --- a/app/Services/Unit3dAnnounce.php +++ b/app/Services/Unit3dAnnounce.php @@ -36,7 +36,7 @@ class Unit3dAnnounce 'upload_factor' => 100, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to add torrent.', ['id' => $torrent->id]); } @@ -50,7 +50,7 @@ class Unit3dAnnounce 'info_hash' => bin2hex($torrent->info_hash), ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to remove torrent', ['id' => $torrent->id]); } @@ -86,7 +86,7 @@ class Unit3dAnnounce 'upload_factor' => $user->group->is_double_upload ? 200 : 100, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to add user', ['id' => $user->id]); } @@ -100,7 +100,7 @@ class Unit3dAnnounce 'passkey' => $user->passkey, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to remove user', ['id' => $user->id]); } @@ -113,7 +113,7 @@ class Unit3dAnnounce 'name' => $blacklistedAgent, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to add blacklisted agent.', ['name' => $blacklistedAgent]); } @@ -126,7 +126,7 @@ class Unit3dAnnounce 'name' => $blacklistedClient->name, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to remove blacklisted agent.', ['name' => $blacklistedClient->name]); } @@ -140,7 +140,7 @@ class Unit3dAnnounce 'torrent_id' => $torrent_id ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to add freeleech token.', ['user_id' => $user_id, 'torrent_id' => $torrent_id]); } @@ -153,7 +153,7 @@ class Unit3dAnnounce 'user_id' => $user_id, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to add personal freeleech.', ['user_id' => $user_id]); } @@ -166,7 +166,7 @@ class Unit3dAnnounce 'user_id' => $user_id, ]); - if (! $isSuccess) { + if (!$isSuccess) { Log::notice('TRACKER - Failed to remove personal freeleech.', ['user_id' => $user_id]); } @@ -185,12 +185,12 @@ class Unit3dAnnounce $attemptsLeft = 3; $route = 'http://'.config('announce.external_tracker.host').':'.config('announce.external_tracker.port').'/announce/'.config('announce.external_tracker.key').'/'.$path; - while (! $isSuccess && $attemptsLeft > 0) { + while (!$isSuccess && $attemptsLeft > 0) { $response = Http::put($route, $data); $isSuccess = $response->ok(); - if (! $isSuccess) { + if (!$isSuccess) { $attemptsLeft -= 1; if ($attemptsLeft > 0) { @@ -217,12 +217,12 @@ class Unit3dAnnounce $attemptsLeft = 3; $route = 'http://'.config('announce.external_tracker.host').':'.config('announce.external_tracker.port').'/announce/'.config('announce.external_tracker.key').'/'.$path; - while (! $isSuccess && $attemptsLeft > 0) { + while (!$isSuccess && $attemptsLeft > 0) { $response = Http::delete($route, $data); $isSuccess = $response->ok(); - if (! $isSuccess) { + if (!$isSuccess) { $attemptsLeft -= 1; if ($attemptsLeft > 0) { diff --git a/app/Traits/Auditable.php b/app/Traits/Auditable.php index baf500b7b..3ec51fe00 100644 --- a/app/Traits/Auditable.php +++ b/app/Traits/Auditable.php @@ -120,7 +120,7 @@ trait Auditable } // Check global discards - if (! empty($globalDiscards) && \in_array($key, $globalDiscards, true)) { + if (!empty($globalDiscards) && \in_array($key, $globalDiscards, true)) { unset($data[$key]); } } @@ -154,7 +154,7 @@ trait Auditable // Generate the JSON to store $data = self::generate('create', [], self::strip($model, $model->getAttributes())); - if (null !== $userId && ! empty($data)) { + if (null !== $userId && !empty($data)) { // Store record $now = Carbon::now()->format('Y-m-d H:i:s'); DB::table('audits')->insert([ @@ -182,7 +182,7 @@ trait Auditable // Generate the JSON to store $data = self::generate('update', self::strip($model, $model->getOriginal()), self::strip($model, $model->getChanges())); - if (null !== $userId && ! empty(json_decode($data, true, 512, JSON_THROW_ON_ERROR))) { + if (null !== $userId && !empty(json_decode($data, true, 512, JSON_THROW_ON_ERROR))) { // Store record $now = Carbon::now()->format('Y-m-d H:i:s'); DB::table('audits')->insert([ @@ -210,7 +210,7 @@ trait Auditable // Generate the JSON to store $data = self::generate('delete', self::strip($model, $model->getAttributes())); - if (null !== $userId && ! empty($data)) { + if (null !== $userId && !empty($data)) { // Store record $now = Carbon::now()->format('Y-m-d H:i:s'); DB::table('audits')->insert([ diff --git a/app/Traits/TorrentFilter.php b/app/Traits/TorrentFilter.php index a73ae5f70..edd5ab63a 100644 --- a/app/Traits/TorrentFilter.php +++ b/app/Traits/TorrentFilter.php @@ -76,7 +76,7 @@ trait TorrentFilter $authenticatedUser === null, fn ($query) => $query->where('anon', '=', false), fn ($query) => $query->when( - ! $authenticatedUser->group->is_modo, + !$authenticatedUser->group->is_modo, fn ($query) => $query->where(fn ($query) => $query->where('anon', '=', false)->orWhere('user_id', '=', $authenticatedUser->id)) ) ); diff --git a/app/Traits/UsersOnlineTrait.php b/app/Traits/UsersOnlineTrait.php index 651105b7c..39f9b6758 100644 --- a/app/Traits/UsersOnlineTrait.php +++ b/app/Traits/UsersOnlineTrait.php @@ -20,7 +20,7 @@ trait UsersOnlineTrait */ public function isOnline(): bool { - if (! $this->last_action) { + if (!$this->last_action) { return false; } diff --git a/database/migrations/2021_10_03_180121_add_indexes_to_tables.php b/database/migrations/2021_10_03_180121_add_indexes_to_tables.php index 2865cd555..a2342213f 100644 --- a/database/migrations/2021_10_03_180121_add_indexes_to_tables.php +++ b/database/migrations/2021_10_03_180121_add_indexes_to_tables.php @@ -14,7 +14,7 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('articles'); - if (! $doctrineTable->hasIndex('created_at')) { + if (!$doctrineTable->hasIndex('created_at')) { $table->index('created_at'); } }); @@ -23,19 +23,19 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('bon_transactions;'); - if (! $doctrineTable->hasIndex('itemID')) { + if (!$doctrineTable->hasIndex('itemID')) { $table->index('itemID'); } - if (! $doctrineTable->hasIndex('sender')) { + if (!$doctrineTable->hasIndex('sender')) { $table->index('sender'); } - if (! $doctrineTable->hasIndex('receiver')) { + if (!$doctrineTable->hasIndex('receiver')) { $table->index('receiver'); } - if (! $doctrineTable->hasIndex('torrent_id')) { + if (!$doctrineTable->hasIndex('torrent_id')) { $table->index('torrent_id'); } }); @@ -44,11 +44,11 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('bookmarks'); - if (! $doctrineTable->hasIndex('user_id')) { + if (!$doctrineTable->hasIndex('user_id')) { $table->index('user_id'); } - if (! $doctrineTable->hasIndex('torrent_id')) { + if (!$doctrineTable->hasIndex('torrent_id')) { $table->index('torrent_id'); } }); @@ -57,7 +57,7 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('posts'); - if (! $doctrineTable->hasIndex('created_at')) { + if (!$doctrineTable->hasIndex('created_at')) { $table->index('created_at'); } }); @@ -66,7 +66,7 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('topics'); - if (! $doctrineTable->hasIndex('created_at')) { + if (!$doctrineTable->hasIndex('created_at')) { $table->index('created_at'); } }); @@ -75,27 +75,27 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('torrents'); - if (! $doctrineTable->hasIndex('status')) { + if (!$doctrineTable->hasIndex('status')) { $table->index('status'); } - if (! $doctrineTable->hasIndex('seeders')) { + if (!$doctrineTable->hasIndex('seeders')) { $table->index('seeders'); } - if (! $doctrineTable->hasIndex('leechers')) { + if (!$doctrineTable->hasIndex('leechers')) { $table->index('leechers'); } - if (! $doctrineTable->hasIndex('sticky')) { + if (!$doctrineTable->hasIndex('sticky')) { $table->index('sticky'); } - if (! $doctrineTable->hasIndex('created_at')) { + if (!$doctrineTable->hasIndex('created_at')) { $table->index('created_at'); } - if (! $doctrineTable->hasIndex('bumped_at')) { + if (!$doctrineTable->hasIndex('bumped_at')) { $table->index('bumped_at'); } }); @@ -104,7 +104,7 @@ return new class () extends Migration { $sm = Schema::getConnection()->getDoctrineSchemaManager(); $doctrineTable = $sm->listTableDetails('users'); - if (! $doctrineTable->hasIndex('deleted_at')) { + if (!$doctrineTable->hasIndex('deleted_at')) { $table->index('deleted_at'); } }); diff --git a/database/migrations/2022_12_30_090331_update_user_notifications_table.php b/database/migrations/2022_12_30_090331_update_user_notifications_table.php index 6985063b4..5d68a5d1c 100644 --- a/database/migrations/2022_12_30_090331_update_user_notifications_table.php +++ b/database/migrations/2022_12_30_090331_update_user_notifications_table.php @@ -44,7 +44,7 @@ return new class () extends Migration { if (\is_object($old) && \is_object($old->default_groups)) { foreach ($old->default_groups as $groupId => $acceptsNotifications) { - if (! $acceptsNotifications && \in_array($groupId, $allowedGroups)) { + if (!$acceptsNotifications && \in_array($groupId, $allowedGroups)) { $new[] = (int) $groupId; } } diff --git a/database/migrations/2022_12_30_090351_update_user_privacy_table.php b/database/migrations/2022_12_30_090351_update_user_privacy_table.php index 167ec72e2..54d1b6a65 100644 --- a/database/migrations/2022_12_30_090351_update_user_privacy_table.php +++ b/database/migrations/2022_12_30_090351_update_user_privacy_table.php @@ -44,7 +44,7 @@ return new class () extends Migration { if (\is_object($old) && \is_object($old->default_groups)) { foreach ($old->default_groups as $groupId => $isAllowed) { - if (! $isAllowed && \in_array($groupId, $allowedGroups)) { + if (!$isAllowed && \in_array($groupId, $allowedGroups)) { $new[] = (int) $groupId; } }