Passed
Push — master ( 546dd7...cd49a3 )
by Darko
21:09
created
app/Models/Release.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
156 156
     {
157 157
         $movieInfoId = null;
158
-        if (! empty($imDbId)) {
158
+        if (!empty($imDbId)) {
159 159
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
160 160
         }
161 161
         self::whereId($id)->update(
@@ -349,7 +349,7 @@  discard block
 block discarded – undo
349 349
 
350 350
         $releases = $query->get();
351 351
 
352
-        $releases->each(function ($release) {
352
+        $releases->each(function($release) {
353 353
             $release->group_name = $release->group->name ?? null;
354 354
             $release->showtitle = $release->video->title ?? null;
355 355
             $release->tvdb = $release->video->tvdb ?? null;
@@ -366,7 +366,7 @@  discard block
 block discarded – undo
366 366
             $release->sub_category = $release->category->title ?? null;
367 367
             $release->category_name = $release->parent_category.' > '.$release->sub_category;
368 368
             $release->category_ids = $release->category->parentid.','.$release->category->id;
369
-            $release->group_names = $release->releaseGroup->map(function ($relGroup) {
369
+            $release->group_names = $release->releaseGroup->map(function($relGroup) {
370 370
                 return $relGroup->group->name;
371 371
             })->implode(',');
372 372
         });
@@ -403,12 +403,12 @@  discard block
 block discarded – undo
403 403
 
404 404
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
405 405
 
406
-        if (! empty($similar)) {
406
+        if (!empty($similar)) {
407 407
             if (config('nntmux.elasticsearch_enabled') === true) {
408 408
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
409 409
             } else {
410 410
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
411
-                if (! empty($searchResult)) {
411
+                if (!empty($searchResult)) {
412 412
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
413 413
                 }
414 414
             }
Please login to merge, or discard this patch.
app/Console/Commands/FixReleaseNames.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,8 +50,7 @@
 block discarded – undo
50 50
         if ($method === '7' || $method === '8') {
51 51
             $compressedHeaders = config('nntmux_nntp.compressed_headers');
52 52
             if ((config('nntmux_nntp.use_alternate_nntp_server') === true ?
53
-                $nntp->doConnect($compressedHeaders, true) :
54
-                $nntp->doConnect()) !== true) {
53
+                $nntp->doConnect($compressedHeaders, true) : $nntp->doConnect()) !== true) {
55 54
                 $this->error('Unable to connect to usenet.');
56 55
 
57 56
                 return 1;
Please login to merge, or discard this patch.
app/Console/Commands/MatchPrefiles.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
         $limit = $this->argument('limit');
35 35
 
36 36
         // Validate the limit argument
37
-        if ($limit !== 'full' && ! is_numeric($limit)) {
37
+        if ($limit !== 'full' && !is_numeric($limit)) {
38 38
             $this->error('Limit must be "full" or a numeric value.');
39 39
 
40 40
             return 1;
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdminNzbController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -114,7 +114,7 @@
 block discarded – undo
114 114
         switch ($errorCode) {
115 115
             case UPLOAD_ERR_INI_SIZE:
116 116
                 return "The file '{$fileName}' exceeds the upload_max_filesize directive (".
117
-                       ini_get('upload_max_filesize').').';
117
+                        ini_get('upload_max_filesize').').';
118 118
             case UPLOAD_ERR_FORM_SIZE:
119 119
                 return "The file '{$fileName}' exceeds the MAX_FILE_SIZE directive specified in the HTML form.";
120 120
             case UPLOAD_ERR_PARTIAL:
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
             $deleteNZB = true;
27 27
 
28 28
             // Get the list of NZB files from php /tmp folder if nzb files were uploaded.
29
-            if (isset($_FILES['uploadedfiles']) && ! empty($_FILES['uploadedfiles']['name'][0])) {
29
+            if (isset($_FILES['uploadedfiles']) && !empty($_FILES['uploadedfiles']['name'][0])) {
30 30
                 $maxFileSize = min(
31 31
                     $this->convertToBytes(ini_get('upload_max_filesize')),
32 32
                     $this->convertToBytes(ini_get('post_max_size'))
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 
55 55
                 // Get the path the user set in the browser if he put one.
56 56
                 $path = ($request->has('folder') ? $request->input('folder') : '');
57
-                if (! Str::endsWith($path, '/')) {
57
+                if (!Str::endsWith($path, '/')) {
58 58
                     $path .= '/';
59 59
                 }
60 60
 
Please login to merge, or discard this patch.
app/Console/Commands/NntmuxPopulateSearchIndexes.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
         $manticore = new ManticoreSearch;
64 64
         $manticore->truncateRTIndex(Arr::wrap('releases_rt'));
65 65
         $total = Release::count();
66
-        if (! $total) {
66
+        if (!$total) {
67 67
             $this->warn('Releases table is empty. Nothing to do.');
68 68
             exit();
69 69
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id'])
84 84
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
85 85
             ->groupBy('id')
86
-            ->chunk($max, function ($releases) use ($manticore, $bar) {
86
+            ->chunk($max, function($releases) use ($manticore, $bar) {
87 87
                 $data = [];
88 88
                 foreach ($releases as $r) {
89 89
                     $data[] = [
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
                     ];
98 98
                     $bar->advance();
99 99
                 }
100
-                if (! empty($data)) {
100
+                if (!empty($data)) {
101 101
                     $manticore->manticoreSearch->table('releases_rt')->replaceDocuments($data);
102 102
                 }
103 103
             });
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
         $manticore->truncateRTIndex(['predb_rt']);
115 115
 
116 116
         $total = Predb::count();
117
-        if (! $total) {
117
+        if (!$total) {
118 118
             $this->warn('PreDB table is empty. Nothing to do.');
119 119
             exit();
120 120
         }
@@ -131,7 +131,7 @@  discard block
 block discarded – undo
131 131
             ->select(['id', 'title', 'filename', 'source'])
132 132
             ->groupBy('id')
133 133
             ->orderBy('id')
134
-            ->chunk($max, function ($pre) use ($manticore, $bar) {
134
+            ->chunk($max, function($pre) use ($manticore, $bar) {
135 135
                 $data = [];
136 136
                 foreach ($pre as $p) {
137 137
                     $data[] = [
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                     ];
144 144
                     $bar->advance();
145 145
                 }
146
-                if (! empty($data)) {
146
+                if (!empty($data)) {
147 147
                     $manticore->manticoreSearch->table('predb_rt')->replaceDocuments($data);
148 148
                 }
149 149
             });
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
         $data = ['body' => []];
158 158
         $elastic = new ElasticSearchSiteSearch;
159 159
         $total = Release::count();
160
-        if (! $total) {
160
+        if (!$total) {
161 161
             $this->warn('Could not get database information for releases table.');
162 162
             exit();
163 163
         }
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate'])
176 176
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
177 177
             ->groupBy('id')
178
-            ->chunk($max, function ($releases) use ($bar, $data) {
178
+            ->chunk($max, function($releases) use ($bar, $data) {
179 179
                 foreach ($releases as $r) {
180 180
                     $searchName = str_replace(['.', '-'], ' ', $r->searchname);
181 181
                     $data['body'][] = [
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
         $data = ['body' => []];
209 209
         $elastic = new ElasticSearchSiteSearch;
210 210
         $total = Predb::count();
211
-        if (! $total) {
211
+        if (!$total) {
212 212
             $this->warn('Could not get database information for predb table.');
213 213
             exit();
214 214
         }
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
             ->select(['id', 'title', 'filename', 'source'])
226 226
             ->groupBy('id')
227 227
             ->orderBy('id')
228
-            ->chunk($max, function ($pre) use ($bar, $data) {
228
+            ->chunk($max, function($pre) use ($bar, $data) {
229 229
                 foreach ($pre as $p) {
230 230
                     $data['body'][] = [
231 231
                         'index' => [
Please login to merge, or discard this patch.
app/Console/Commands/CreateManticoreIndexes.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
         // Create each index
97 97
         foreach ($indexes as $indexName => $schema) {
98
-            if (! $this->createIndex($indexName, $schema, $dropExisting)) {
98
+            if (!$this->createIndex($indexName, $schema, $dropExisting)) {
99 99
                 $hasErrors = true;
100 100
             }
101 101
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
                     $indices->drop(['index' => $indexName, 'body' => ['silent' => true]]);
128 128
                     $this->info("Successfully dropped {$indexName} index.");
129 129
                 } catch (ResponseException $e) {
130
-                    if (! str_contains($e->getMessage(), 'unknown index')) {
130
+                    if (!str_contains($e->getMessage(), 'unknown index')) {
131 131
                         $this->warn("Warning when dropping {$indexName} index: ".$e->getMessage());
132 132
                     }
133 133
                 }
Please login to merge, or discard this patch.
app/Jobs/RemoveInactiveAccounts.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,11 +30,11 @@
 block discarded – undo
30 30
     {
31 31
         $purgeDays = config('nntmux.purge_inactive_users_days');
32 32
         User::query()->where('roles_id', '=', 1)
33
-            ->where(function ($query) use ($purgeDays) {
33
+            ->where(function($query) use ($purgeDays) {
34 34
                 $query->where('lastlogin', '<', now()->subDays($purgeDays))
35 35
                     ->orWhereNull('lastlogin');
36 36
             })
37
-            ->where(function ($query) use ($purgeDays) {
37
+            ->where(function($query) use ($purgeDays) {
38 38
                 $query->where('apiaccess', '<', now()->subDays($purgeDays))
39 39
                     ->orWhereNull('apiaccess');
40 40
             })
Please login to merge, or discard this patch.
app/Http/Controllers/ProfileSecurityController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@
 block discarded – undo
29 29
         ]);
30 30
 
31 31
         // Check if password is correct
32
-        if (! Hash::check($validated['current_password'], Auth::user()->password)) {
32
+        if (!Hash::check($validated['current_password'], Auth::user()->password)) {
33 33
             if ($request->expectsJson() || $request->ajax()) {
34 34
                 return response()->json([
35 35
                     'success' => false,
Please login to merge, or discard this patch.
app/Http/Controllers/PasswordSecurityController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 
88 88
     public function disable2fa(Disable2faPasswordSecurityRequest $request): \Illuminate\Routing\Redirector|RedirectResponse|\Illuminate\Contracts\Foundation\Application
89 89
     {
90
-        if (! (Hash::check($request->get('current-password'), $request->user()->password))) {
90
+        if (!(Hash::check($request->get('current-password'), $request->user()->password))) {
91 91
             // Password doesn't match
92 92
             if ($request->has('redirect_to_profile') || $request->has('from_profile')) {
93 93
                 return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.');
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         ]);
120 120
 
121 121
         // Get the user ID from session
122
-        if (! $request->session()->has('2fa:user:id')) {
122
+        if (!$request->session()->has('2fa:user:id')) {
123 123
             return redirect()->route('login')
124 124
                 ->with('message', 'The two-factor authentication session has expired. Please login again.')
125 125
                 ->with('message_type', 'danger');
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $userId = $request->session()->get('2fa:user:id');
129 129
         $user = \App\Models\User::find($userId);
130 130
 
131
-        if (! $user || ! $user->passwordSecurity) {
131
+        if (!$user || !$user->passwordSecurity) {
132 132
             $request->session()->forget('2fa:user:id');
133 133
 
134 134
             return redirect()->route('login')
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
             $request->input('one_time_password')
143 143
         );
144 144
 
145
-        if (! $valid) {
145
+        if (!$valid) {
146 146
             return redirect()->route('2fa.verify')
147 147
                 ->with('message', 'Invalid authentication code. Please try again.')
148 148
                 ->with('message_type', 'danger');
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
     public function getVerify2fa(Request $request)
176 176
     {
177 177
         // Check if user ID is stored in the session
178
-        if (! $request->session()->has('2fa:user:id')) {
178
+        if (!$request->session()->has('2fa:user:id')) {
179 179
             return redirect()->route('login')
180 180
                 ->withErrors(['msg' => 'The two-factor authentication session has expired. Please login again.']);
181 181
         }
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
         // Get the user
187 187
         $user = \App\Models\User::find($userId);
188
-        if (! $user) {
188
+        if (!$user) {
189 189
             $request->session()->forget('2fa:user:id');
190 190
 
191 191
             return redirect()->route('login')
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
             'current-password' => 'required',
213 213
         ]);
214 214
 
215
-        if (! (Hash::check($request->get('current-password'), $request->user()->password))) {
215
+        if (!(Hash::check($request->get('current-password'), $request->user()->password))) {
216 216
             return redirect()->to('profileedit#security')->with('error_2fa', 'Your password does not match with your account password. Please try again.');
217 217
         }
218 218
 
Please login to merge, or discard this patch.