@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | $guid = ''; |
| 38 | 38 | |
| 39 | 39 | if ($idOpt !== null && $idOpt !== '') { |
| 40 | - if (! ctype_digit((string) $idOpt)) { |
|
| 40 | + if (!ctype_digit((string) $idOpt)) { |
|
| 41 | 41 | $this->error('Release ID must be numeric.'); |
| 42 | 42 | |
| 43 | 43 | return 5; // invalid id format |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | $processor = new ProcessAdditional; |
| 84 | 84 | $ok = $processor->processSingleGuid($guid); |
| 85 | 85 | |
| 86 | - if (! $ok) { |
|
| 86 | + if (!$ok) { |
|
| 87 | 87 | $this->error('Processing failed or nothing processed for '.($idOpt ? 'ID '.$idOpt : 'GUID '.$guid).'.'); |
| 88 | 88 | |
| 89 | 89 | return 3; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | // Add any advanced criteria |
| 71 | 71 | $advancedCriteria = $this->argument('criteria'); |
| 72 | - if (! empty($advancedCriteria)) { |
|
| 72 | + if (!empty($advancedCriteria)) { |
|
| 73 | 73 | $criteria = array_merge($criteria, $advancedCriteria); |
| 74 | 74 | } |
| 75 | 75 | |
@@ -90,14 +90,14 @@ discard block |
||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | // Show confirmation unless force flag is set |
| 93 | - if (! $force) { |
|
| 93 | + if (!$force) { |
|
| 94 | 94 | $this->warn('You are about to delete releases matching the following criteria:'); |
| 95 | 95 | foreach ($criteria as $criterion) { |
| 96 | 96 | $this->line(" - {$criterion}"); |
| 97 | 97 | } |
| 98 | 98 | $this->newLine(); |
| 99 | 99 | |
| 100 | - if (! $this->confirm('Are you sure you want to proceed with the deletion?')) { |
|
| 100 | + if (!$this->confirm('Are you sure you want to proceed with the deletion?')) { |
|
| 101 | 101 | $this->info('Operation cancelled.'); |
| 102 | 102 | |
| 103 | 103 | return 0; |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | |
| 110 | 110 | // Build the query to find releases to delete |
| 111 | 111 | $query = $this->buildQueryFromCriteria($criteria); |
| 112 | - if (! $query) { |
|
| 112 | + if (!$query) { |
|
| 113 | 113 | $this->error('Could not build query from criteria.'); |
| 114 | 114 | |
| 115 | 115 | return 1; |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | // Get the query that would be executed |
| 190 | 190 | $query = $this->buildQueryFromCriteria($criteria); |
| 191 | 191 | |
| 192 | - if (! $query) { |
|
| 192 | + if (!$query) { |
|
| 193 | 193 | $this->error('Could not build query from criteria.'); |
| 194 | 194 | |
| 195 | 195 | return 1; |
@@ -348,13 +348,13 @@ discard block |
||
| 348 | 348 | switch ($modifier) { |
| 349 | 349 | case 'equals': |
| 350 | 350 | $group = DB::select('SELECT id FROM usenet_groups WHERE name = ?', [$value]); |
| 351 | - if (! empty($group)) { |
|
| 351 | + if (!empty($group)) { |
|
| 352 | 352 | return " AND groups_id = {$group[0]->id}"; |
| 353 | 353 | } |
| 354 | 354 | break; |
| 355 | 355 | case 'like': |
| 356 | 356 | $groups = DB::select('SELECT id FROM usenet_groups WHERE name LIKE ?', ['%'.str_replace(' ', '%', $value).'%']); |
| 357 | - if (! empty($groups)) { |
|
| 357 | + if (!empty($groups)) { |
|
| 358 | 358 | $ids = array_column($groups, 'id'); |
| 359 | 359 | |
| 360 | 360 | return ' AND groups_id IN ('.implode(',', $ids).')'; |
@@ -98,7 +98,7 @@ |
||
| 98 | 98 | |
| 99 | 99 | $query = clone $baseQuery; |
| 100 | 100 | |
| 101 | - $query->chunkById($chunkSize, function ($releases) use (&$processed, &$failed, &$remaining, $bar, $showOutput) { |
|
| 101 | + $query->chunkById($chunkSize, function($releases) use (&$processed, &$failed, &$remaining, $bar, $showOutput) { |
|
| 102 | 102 | foreach ($releases as $release) { |
| 103 | 103 | if ($remaining <= 0) { |
| 104 | 104 | return false; // stop chunking |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | public function reply($user, Thread $thread): bool |
| 22 | 22 | { |
| 23 | 23 | // Admins can reply even if locked; otherwise respect lock state |
| 24 | - return $user->hasRole('Admin') || (! $thread->locked); |
|
| 24 | + return $user->hasRole('Admin') || (!$thread->locked); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function delete($user, Thread $thread): bool |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | // Share global data with all views using View Composer |
| 23 | 23 | view()->composer('*', \App\View\Composers\GlobalDataComposer::class); |
| 24 | 24 | |
| 25 | - Gate::define('viewPulse', function (User $user) { |
|
| 25 | + Gate::define('viewPulse', function(User $user) { |
|
| 26 | 26 | return $user->hasRole('Admin'); |
| 27 | 27 | }); |
| 28 | 28 | Event::listen(Login::class, LoginViaRemember::class); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | ->groupBy('roles.id', 'roles.name') |
| 23 | 23 | ->get(); |
| 24 | 24 | |
| 25 | - return $usersByRole->map(function ($item) { |
|
| 25 | + return $usersByRole->map(function($item) { |
|
| 26 | 26 | return [ |
| 27 | 27 | 'role' => $item->role_name, |
| 28 | 28 | 'count' => $item->count, |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $results = $this->paginate($rslt ?? [], $rslt[0]->_totalcount ?? 0, config('nntmux.items_per_cover_page'), $page, $request->url(), $request->query()); |
| 49 | 49 | $maxwords = 50; |
| 50 | 50 | foreach ($results as $result) { |
| 51 | - if (! empty($result->overview)) { |
|
| 51 | + if (!empty($result->overview)) { |
|
| 52 | 52 | $words = explode(' ', $result->overview); |
| 53 | 53 | if (\count($words) > $maxwords) { |
| 54 | 54 | $newwords = \array_slice($words, 0, $maxwords); |
@@ -58,9 +58,9 @@ discard block |
||
| 58 | 58 | $books[] = $result; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - $author = ($request->has('author') && ! empty($request->input('author'))) ? stripslashes($request->input('author')) : ''; |
|
| 61 | + $author = ($request->has('author') && !empty($request->input('author'))) ? stripslashes($request->input('author')) : ''; |
|
| 62 | 62 | |
| 63 | - $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 63 | + $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : ''; |
|
| 64 | 64 | |
| 65 | 65 | $browseby_link = '&title='.$title.'&author='.$author; |
| 66 | 66 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $id = $request->input('id'); |
| 45 | 45 | $con = $console->getConsoleInfo($id); |
| 46 | 46 | |
| 47 | - if (! $con) { |
|
| 47 | + if (!$con) { |
|
| 48 | 48 | abort(404); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -55,14 +55,14 @@ discard block |
||
| 55 | 55 | if ($request->hasFile('cover') && $request->file('cover')->isValid()) { |
| 56 | 56 | $uploadedFile = $request->file('cover'); |
| 57 | 57 | $file_info = getimagesize($uploadedFile->getRealPath()); |
| 58 | - if (! empty($file_info)) { |
|
| 58 | + if (!empty($file_info)) { |
|
| 59 | 59 | $uploadedFile->move(storage_path('covers/console'), $id.'.jpg'); |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | $hasCover = file_exists($coverLoc) ? 1 : 0; |
| 64 | - $salesrank = (empty($request->input('salesrank')) || ! ctype_digit($request->input('salesrank'))) ? null : $request->input('salesrank'); |
|
| 65 | - $releasedate = (empty($request->input('releasedate')) || ! strtotime($request->input('releasedate'))) |
|
| 64 | + $salesrank = (empty($request->input('salesrank')) || !ctype_digit($request->input('salesrank'))) ? null : $request->input('salesrank'); |
|
| 65 | + $releasedate = (empty($request->input('releasedate')) || !strtotime($request->input('releasedate'))) |
|
| 66 | 66 | ? $con['releasedate'] |
| 67 | 67 | : Carbon::parse($request->input('releasedate'))->timestamp; |
| 68 | 68 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $meta_title = $title = 'Release Naming Regex List'; |
| 21 | 21 | |
| 22 | 22 | $group = ''; |
| 23 | - if ($request->has('group') && ! empty($request->input('group'))) { |
|
| 23 | + if ($request->has('group') && !empty($request->input('group'))) { |
|
| 24 | 24 | $group = $request->input('group'); |
| 25 | 25 | } |
| 26 | 26 | $regex = $regexes->getRegex($group); |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $request->merge(['description' => '']); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | - if (! is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
| 70 | + if (!is_numeric($request->input('ordinal')) || $request->input('ordinal') < 0) { |
|
| 71 | 71 | $error = 'Ordinal must be a number, 0 or higher.'; |
| 72 | 72 | break; |
| 73 | 73 | } |
@@ -113,8 +113,8 @@ discard block |
||
| 113 | 113 | $this->setAdminPrefs(); |
| 114 | 114 | $meta_title = $title = 'Release Naming Regex Test'; |
| 115 | 115 | |
| 116 | - $group = trim($request->has('group') && ! empty($request->input('group')) ? $request->input('group') : ''); |
|
| 117 | - $regex = trim($request->has('regex') && ! empty($request->input('regex')) ? $request->input('regex') : ''); |
|
| 116 | + $group = trim($request->has('group') && !empty($request->input('group')) ? $request->input('group') : ''); |
|
| 117 | + $regex = trim($request->has('regex') && !empty($request->input('regex')) ? $request->input('regex') : ''); |
|
| 118 | 118 | $showLimit = ($request->has('showlimit') && is_numeric($request->input('showlimit')) ? $request->input('showlimit') : 250); |
| 119 | 119 | $queryLimit = ($request->has('querylimit') && is_numeric($request->input('querylimit')) ? $request->input('querylimit') : 100000); |
| 120 | 120 | |