@@ -195,7 +195,7 @@ |
||
| 195 | 195 | return $predb; |
| 196 | 196 | } |
| 197 | 197 | $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate'); |
| 198 | - if (! empty($search)) { |
|
| 198 | + if (!empty($search)) { |
|
| 199 | 199 | if (config('nntmux.elasticsearch_enabled') === true) { |
| 200 | 200 | $ids = (new ElasticSearchSiteSearch())->predbIndexSearch($search); |
| 201 | 201 | } else { |
@@ -486,15 +486,15 @@ discard block |
||
| 486 | 486 | public static function getForMenu(array $excludedCats = []): array |
| 487 | 487 | { |
| 488 | 488 | $categoriesResult = []; |
| 489 | - $categoriesArray = RootCategory::query()->with(['categories' => function ($query) use ($excludedCats) { |
|
| 490 | - if (! empty($excludedCats)) { |
|
| 489 | + $categoriesArray = RootCategory::query()->with(['categories' => function($query) use ($excludedCats) { |
|
| 490 | + if (!empty($excludedCats)) { |
|
| 491 | 491 | $query->whereNotIn('id', $excludedCats); |
| 492 | 492 | } |
| 493 | 493 | $query->select(['id', 'title', 'root_categories_id', 'description']); |
| 494 | 494 | }])->select(['id', 'title'])->get()->toArray(); |
| 495 | 495 | |
| 496 | 496 | foreach ($categoriesArray as $category) { |
| 497 | - if (! empty($category['categories'])) { |
|
| 497 | + if (!empty($category['categories'])) { |
|
| 498 | 498 | $categoriesResult[] = $category; |
| 499 | 499 | } |
| 500 | 500 | } |
@@ -552,7 +552,7 @@ discard block |
||
| 552 | 552 | $sql->where('status', '=', self::STATUS_ACTIVE); |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | - if (! empty($excludedCats)) { |
|
| 555 | + if (!empty($excludedCats)) { |
|
| 556 | 556 | $sql->whereNotIn('id', $excludedCats); |
| 557 | 557 | } |
| 558 | 558 | |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | 'rate_limit' => $rateLimit, |
| 33 | 33 | ] |
| 34 | 34 | ); |
| 35 | - if (! empty(config('mail.from.address') && File::isFile(base_path().'/_install/install.lock'))) { |
|
| 35 | + if (!empty(config('mail.from.address') && File::isFile(base_path().'/_install/install.lock'))) { |
|
| 36 | 36 | SendNewRegisteredAccountMail::dispatch($user)->onQueue('newreg'); |
| 37 | 37 | SendWelcomeEmail::dispatch($user)->onQueue('welcomeemails'); |
| 38 | 38 | UserVerification::generate($user); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function register(): void |
| 32 | 32 | { |
| 33 | - $this->reportable(function (Throwable $e) { |
|
| 33 | + $this->reportable(function(Throwable $e) { |
|
| 34 | 34 | if (app()->bound('sentry')) { |
| 35 | 35 | app('sentry')->captureException($e); |
| 36 | 36 | } |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | |
| 19 | 19 | $this->hideSensitiveRequestDetails(); |
| 20 | 20 | |
| 21 | - Telescope::filter(function (IncomingEntry $entry) { |
|
| 21 | + Telescope::filter(function(IncomingEntry $entry) { |
|
| 22 | 22 | if ($this->app->isLocal() || config('telescope.full_enabled_in_production') === true) { |
| 23 | 23 | return true; |
| 24 | 24 | } |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | protected function gate(): void |
| 57 | 57 | { |
| 58 | - Gate::define('viewTelescope', function ($user) { |
|
| 58 | + Gate::define('viewTelescope', function($user) { |
|
| 59 | 59 | return in_array($user->email, [ |
| 60 | 60 | config('nntmux.admin_email'), |
| 61 | 61 | ], true); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | protected function gate(): void |
| 29 | 29 | { |
| 30 | - Gate::define('viewHorizon', function ($user) { |
|
| 30 | + Gate::define('viewHorizon', function($user) { |
|
| 31 | 31 | return in_array($user->email, [ |
| 32 | 32 | config('nntmux.admin_email'), |
| 33 | 33 | ], true); |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | use Symfony\Component\Process\Process; |
| 17 | 17 | use Zip as ZipStream; |
| 18 | 18 | |
| 19 | -if (! function_exists('getRawHtml')) { |
|
| 19 | +if (!function_exists('getRawHtml')) { |
|
| 20 | 20 | /** |
| 21 | 21 | * @param bool $cookie |
| 22 | 22 | * @return bool|mixed|string |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | -if (! function_exists('makeFieldLinks')) { |
|
| 54 | +if (!function_exists('makeFieldLinks')) { |
|
| 55 | 55 | /** |
| 56 | 56 | * @return string |
| 57 | 57 | * |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | } |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | -if (! function_exists('getUserBrowseOrder')) { |
|
| 84 | +if (!function_exists('getUserBrowseOrder')) { |
|
| 85 | 85 | /** |
| 86 | 86 | * @param string $orderBy |
| 87 | 87 | */ |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -if (! function_exists('getUserBrowseOrdering')) { |
|
| 110 | +if (!function_exists('getUserBrowseOrdering')) { |
|
| 111 | 111 | function getUserBrowseOrdering(): array |
| 112 | 112 | { |
| 113 | 113 | return [ |
@@ -137,21 +137,21 @@ discard block |
||
| 137 | 137 | } |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | -if (! function_exists('createGUID')) { |
|
| 140 | +if (!function_exists('createGUID')) { |
|
| 141 | 141 | /** |
| 142 | 142 | * @throws \Exception |
| 143 | 143 | */ |
| 144 | 144 | function createGUID(): string |
| 145 | 145 | { |
| 146 | 146 | $data = random_bytes(16); |
| 147 | - $data[6] = \chr(\ord($data[6]) & 0x0F | 0x40); // set version to 0100 |
|
| 148 | - $data[8] = \chr(\ord($data[8]) & 0x3F | 0x80); // set bits 6-7 to 10 |
|
| 147 | + $data[6] = \chr(\ord($data[6]) & 0x0F|0x40); // set version to 0100 |
|
| 148 | + $data[8] = \chr(\ord($data[8]) & 0x3F|0x80); // set bits 6-7 to 10 |
|
| 149 | 149 | |
| 150 | 150 | return vsprintf('%s%s-%s-%s-%s-%s%s%s', str_split(sodium_bin2hex($data), 4)); |
| 151 | 151 | } |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | -if (! function_exists('getSimilarName')) { |
|
| 154 | +if (!function_exists('getSimilarName')) { |
|
| 155 | 155 | /** |
| 156 | 156 | * @param string $name |
| 157 | 157 | */ |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | } |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | -if (! function_exists('color')) { |
|
| 164 | +if (!function_exists('color')) { |
|
| 165 | 165 | /** |
| 166 | 166 | * @param string $string |
| 167 | 167 | */ |
@@ -171,7 +171,7 @@ discard block |
||
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | -if (! function_exists('human_filesize')) { |
|
| 174 | +if (!function_exists('human_filesize')) { |
|
| 175 | 175 | /** |
| 176 | 176 | * @param int $decimals |
| 177 | 177 | */ |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | -if (! function_exists('bcdechex')) { |
|
| 187 | +if (!function_exists('bcdechex')) { |
|
| 188 | 188 | /** |
| 189 | 189 | * @return string |
| 190 | 190 | */ |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | } |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | -if (! function_exists('runCmd')) { |
|
| 204 | +if (!function_exists('runCmd')) { |
|
| 205 | 205 | /** |
| 206 | 206 | * Run CLI command. |
| 207 | 207 | * |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | -if (! function_exists('escapeString')) { |
|
| 232 | +if (!function_exists('escapeString')) { |
|
| 233 | 233 | /** |
| 234 | 234 | * @return string |
| 235 | 235 | */ |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | } |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | -if (! function_exists('realDuration')) { |
|
| 242 | +if (!function_exists('realDuration')) { |
|
| 243 | 243 | /** |
| 244 | 244 | * @return string |
| 245 | 245 | */ |
@@ -251,7 +251,7 @@ discard block |
||
| 251 | 251 | } |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | -if (! function_exists('is_it_json')) { |
|
| 254 | +if (!function_exists('is_it_json')) { |
|
| 255 | 255 | /** |
| 256 | 256 | * @param array|string $isIt |
| 257 | 257 | * @return bool |
@@ -296,7 +296,7 @@ discard block |
||
| 296 | 296 | return $zipped; |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | -if (! function_exists('release_flag')) { |
|
| 299 | +if (!function_exists('release_flag')) { |
|
| 300 | 300 | // Function inspired by c0r3@newznabforums adds country flags on the browse page. |
| 301 | 301 | /** |
| 302 | 302 | * @param string $text Text to match against. |
@@ -432,10 +432,10 @@ discard block |
||
| 432 | 432 | |
| 433 | 433 | return ''; |
| 434 | 434 | } |
| 435 | - if (! function_exists('sanitize')) { |
|
| 435 | + if (!function_exists('sanitize')) { |
|
| 436 | 436 | function sanitize(array|string $phrases, array $doNotSanitize = []): string |
| 437 | 437 | { |
| 438 | - if (! is_array($phrases)) { |
|
| 438 | + if (!is_array($phrases)) { |
|
| 439 | 439 | $wordArray = explode(' ', str_replace('.', ' ', $phrases)); |
| 440 | 440 | } else { |
| 441 | 441 | $wordArray = $phrases; |
@@ -446,9 +446,9 @@ discard block |
||
| 446 | 446 | foreach ($wordArray as $words) { |
| 447 | 447 | $words = preg_split('/\s+/', $words); |
| 448 | 448 | foreach ($words as $st) { |
| 449 | - if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 449 | + if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 450 | 450 | $str = $st; |
| 451 | - } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 451 | + } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) { |
|
| 452 | 452 | $str = $st; |
| 453 | 453 | } else { |
| 454 | 454 | $str = Sanitizer::escape($st, $doNotSanitize); |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | for ($chr = 0; $chr < $encodedLength; $chr++) { |
| 59 | 59 | $decoded .= ( |
| 60 | 60 | $encoded[$chr] === '=' ? |
| 61 | - \chr((\ord($encoded[$chr]) - 42) % 256) : |
|
| 62 | - \chr((((\ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 61 | + \chr((\ord($encoded[$chr]) - 42) % 256) : \chr((((\ord($encoded[++$chr]) - 64) % 256) - 42) % 256) |
|
| 63 | 62 | ); |
| 64 | 63 | } |
| 65 | 64 | |
@@ -113,8 +112,7 @@ discard block |
||
| 113 | 112 | for ($chr = 0; $chr < $length; $chr++) { |
| 114 | 113 | $text .= ( |
| 115 | 114 | $input[$chr] === '=' ? |
| 116 | - \chr((((\ord($input[++$chr]) - 64) % 256) - 42) % 256) : |
|
| 117 | - \chr((\ord($input[$chr]) - 42) % 256) |
|
| 115 | + \chr((((\ord($input[++$chr]) - 64) % 256) - 42) % 256) : \chr((\ord($input[$chr]) - 42) % 256) |
|
| 118 | 116 | ); |
| 119 | 117 | } |
| 120 | 118 | } |
@@ -9,13 +9,13 @@ |
||
| 9 | 9 | { |
| 10 | 10 | protected function canPassWithoutCheckingOTP(): bool |
| 11 | 11 | { |
| 12 | - if (! $this->getUser()->passwordSecurity) { |
|
| 12 | + if (!$this->getUser()->passwordSecurity) { |
|
| 13 | 13 | return true; |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | 16 | return |
| 17 | - ! $this->getUser()->passwordSecurity->google2fa_enable || |
|
| 18 | - ! $this->isEnabled() || |
|
| 17 | + !$this->getUser()->passwordSecurity->google2fa_enable || |
|
| 18 | + !$this->isEnabled() || |
|
| 19 | 19 | $this->noUserIsAuthenticated() || |
| 20 | 20 | $this->twoFactorAuthStillValid(); |
| 21 | 21 | } |