Passed
Push — master ( 022e93...61beee )
by Darko
10:18
created
app/Http/Controllers/ProfileController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
         $privateProfiles = config('nntmux_settings.private_profiles');
31 31
         $publicView = false;
32 32
 
33
-        if ($privileged || ! $privateProfiles) {
33
+        if ($privileged || !$privateProfiles) {
34 34
             $altID = ($request->has('id') && (int) $request->input('id') >= 0) ? (int) $request->input('id') : false;
35 35
             $altUsername = ($request->has('name') && $request->input('name') !== '') ? $request->input('name') : false;
36 36
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
         }
58 58
 
59 59
         // Check if the user selected a theme.
60
-        if (! isset($this->userdata->style) || $this->userdata->style === 'None') {
60
+        if (!isset($this->userdata->style) || $this->userdata->style === 'None') {
61 61
             $this->userdata->style = 'Using the admin selected theme.';
62 62
         }
63 63
 
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
         $action = $request->input('action') ?? 'view';
92 92
 
93 93
         $userid = $this->userdata->id;
94
-        if (! $this->userdata) {
94
+        if (!$this->userdata) {
95 95
             $this->show404('No such user!');
96 96
         }
97 97
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 
102 102
         // Generate 2FA QR code URL if 2FA is set up but not enabled
103 103
         $google2fa_url = '';
104
-        if ($this->userdata->passwordSecurity()->exists() && ! $this->userdata->passwordSecurity->google2fa_enable) {
104
+        if ($this->userdata->passwordSecurity()->exists() && !$this->userdata->passwordSecurity->google2fa_enable) {
105 105
             $google2fa_url = \Google2FA::getQRCodeInline(
106 106
                 config('app.name'),
107 107
                 $this->userdata->email,
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
                     // Handle Console permission
154 154
                     if ($request->has('viewconsole')) {
155
-                        if (! $this->userdata->hasDirectPermission('view console')) {
155
+                        if (!$this->userdata->hasDirectPermission('view console')) {
156 156
                             $this->userdata->givePermissionTo('view console');
157 157
                         }
158 158
                     } else {
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 
164 164
                     // Handle Movies permission
165 165
                     if ($request->has('viewmovies')) {
166
-                        if (! $this->userdata->hasDirectPermission('view movies')) {
166
+                        if (!$this->userdata->hasDirectPermission('view movies')) {
167 167
                             $this->userdata->givePermissionTo('view movies');
168 168
                         }
169 169
                     } else {
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 
175 175
                     // Handle Audio permission
176 176
                     if ($request->has('viewaudio')) {
177
-                        if (! $this->userdata->hasDirectPermission('view audio')) {
177
+                        if (!$this->userdata->hasDirectPermission('view audio')) {
178 178
                             $this->userdata->givePermissionTo('view audio');
179 179
                         }
180 180
                     } else {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 
186 186
                     // Handle PC/Games permission
187 187
                     if ($request->has('viewpc')) {
188
-                        if (! $this->userdata->hasDirectPermission('view pc')) {
188
+                        if (!$this->userdata->hasDirectPermission('view pc')) {
189 189
                             $this->userdata->givePermissionTo('view pc');
190 190
                         }
191 191
                     } else {
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
 
197 197
                     // Handle TV permission
198 198
                     if ($request->has('viewtv')) {
199
-                        if (! $this->userdata->hasDirectPermission('view tv')) {
199
+                        if (!$this->userdata->hasDirectPermission('view tv')) {
200 200
                             $this->userdata->givePermissionTo('view tv');
201 201
                         }
202 202
                     } else {
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 
208 208
                     // Handle Adult permission
209 209
                     if ($request->has('viewadult')) {
210
-                        if (! $this->userdata->hasDirectPermission('view adult')) {
210
+                        if (!$this->userdata->hasDirectPermission('view adult')) {
211 211
                             $this->userdata->givePermissionTo('view adult');
212 212
                         }
213 213
                     } else {
@@ -218,7 +218,7 @@  discard block
 block discarded – undo
218 218
 
219 219
                     // Handle Books permission
220 220
                     if ($request->has('viewbooks')) {
221
-                        if (! $this->userdata->hasDirectPermission('view books')) {
221
+                        if (!$this->userdata->hasDirectPermission('view books')) {
222 222
                             $this->userdata->givePermissionTo('view books');
223 223
                         }
224 224
                     } else {
@@ -229,7 +229,7 @@  discard block
 block discarded – undo
229 229
 
230 230
                     // Handle Other permission
231 231
                     if ($request->has('viewother')) {
232
-                        if (! $this->userdata->hasDirectPermission('view other')) {
232
+                        if (!$this->userdata->hasDirectPermission('view other')) {
233 233
                             $this->userdata->givePermissionTo('view other');
234 234
                         }
235 235
                     } else {
@@ -238,12 +238,12 @@  discard block
 block discarded – undo
238 238
                         }
239 239
                     }
240 240
 
241
-                    if ($request->has('password') && ! empty($request->input('password'))) {
241
+                    if ($request->has('password') && !empty($request->input('password'))) {
242 242
                         User::updatePassword($userid, $request->input('password'));
243 243
                     }
244 244
 
245
-                    if (! $this->userdata->hasRole('Admin')) {
246
-                        if (! empty($request->input('email')) && $this->userdata->email !== $request->input('email')) {
245
+                    if (!$this->userdata->hasRole('Admin')) {
246
+                        if (!empty($request->input('email')) && $this->userdata->email !== $request->input('email')) {
247 247
                             $this->userdata->email = $request->input('email');
248 248
 
249 249
                             $verify_user = $this->userdata;
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
     {
295 295
         $userId = $request->input('id');
296 296
 
297
-        if ($userId !== null && (int) $userId === $this->userdata->id && ! $this->userdata->hasRole('Admin')) {
297
+        if ($userId !== null && (int) $userId === $this->userdata->id && !$this->userdata->hasRole('Admin')) {
298 298
             $user = User::find($userId);
299 299
             SendAccountDeletedEmail::dispatch($user);
300 300
             Auth::logout();
@@ -315,7 +315,7 @@  discard block
 block discarded – undo
315 315
     {
316 316
         $user = Auth::user();
317 317
 
318
-        if (! $user) {
318
+        if (!$user) {
319 319
             return response()->json(['success' => false, 'message' => 'User not authenticated'], 401);
320 320
         }
321 321
 
Please login to merge, or discard this patch.
app/Http/Controllers/InvitationController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->viewData['meta_description'] = 'Manage your sent invitations and send new invitations to friends';
36 36
         $this->viewData['status'] = $status;
37 37
 
38
-        if (! $inviteMode) {
38
+        if (!$inviteMode) {
39 39
             // Invitations disabled: show informational message only, no queries.
40 40
             $this->viewData['invite_mode'] = false;
41 41
             $this->viewData['stats'] = [];
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
         $this->viewData['meta_keywords'] = 'invitation,invite,send,new,user';
96 96
         $this->viewData['meta_description'] = 'Send a new invitation to invite someone to join the site';
97 97
 
98
-        if (! $inviteMode) {
98
+        if (!$inviteMode) {
99 99
             $this->viewData['invite_mode'] = false;
100 100
             $this->viewData['meta_title'] = 'Invitations Disabled';
101 101
             $this->viewData['meta_keywords'] = 'invitations,disabled';
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
     public function cleanup(): JsonResponse
272 272
     {
273 273
         // Check if user is admin
274
-        if (! auth()->user()->hasRole('admin')) {
274
+        if (!auth()->user()->hasRole('admin')) {
275 275
             abort(403, 'Unauthorized');
276 276
         }
277 277
 
Please login to merge, or discard this patch.
app/Http/Controllers/Api/FileListApiController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,13 +17,13 @@
 block discarded – undo
17 17
         $nzb = new NZB;
18 18
 
19 19
         $rel = Release::getByGuid($guid);
20
-        if (! $rel) {
20
+        if (!$rel) {
21 21
             return response()->json(['error' => 'Release not found'], 404);
22 22
         }
23 23
 
24 24
         $nzbpath = $nzb->NZBPath($guid);
25 25
 
26
-        if (! file_exists($nzbpath)) {
26
+        if (!file_exists($nzbpath)) {
27 27
             return response()->json(['error' => 'NZB file not found'], 404);
28 28
         }
29 29
 
Please login to merge, or discard this patch.
app/Http/Controllers/ConsoleController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 
54 54
         $maxwords = 50;
55 55
         foreach ($results as $result) {
56
-            if (! empty($result->review)) {
56
+            if (!empty($result->review)) {
57 57
                 $words = explode(' ', $result->review);
58 58
                 if (\count($words) > $maxwords) {
59 59
                     $newwords = \array_slice($words, 0, $maxwords);
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
             $consoles[] = $result;
64 64
         }
65 65
 
66
-        $platform = ($request->has('platform') && ! empty($request->input('platform'))) ? stripslashes($request->input('platform')) : '';
67
-        $title = ($request->has('title') && ! empty($request->input('title'))) ? stripslashes($request->input('title')) : '';
66
+        $platform = ($request->has('platform') && !empty($request->input('platform'))) ? stripslashes($request->input('platform')) : '';
67
+        $title = ($request->has('title') && !empty($request->input('title'))) ? stripslashes($request->input('title')) : '';
68 68
 
69 69
         $genres = $gen->getGenres(Genres::CONSOLE_TYPE, true);
70 70
         $tmpgnr = [];
Please login to merge, or discard this patch.
app/Models/MovieInfo.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -82,9 +82,9 @@
 block discarded – undo
82 82
             return $movie;
83 83
         }
84 84
         $sql = self::query()->select('*');
85
-        if (! empty($search)) {
85
+        if (!empty($search)) {
86 86
             // Search by both title and IMDB ID
87
-            $sql->where(function ($query) use ($search) {
87
+            $sql->where(function($query) use ($search) {
88 88
                 $query->whereLike('title', '%'.$search.'%')
89 89
                     ->orWhere('imdbid', $search);
90 90
             });
Please login to merge, or discard this patch.
app/Models/Predb.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -199,7 +199,7 @@
 block discarded – undo
199 199
             ->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')
200 200
             ->select('predb.*', 'releases.guid')
201 201
             ->orderByDesc('predb.predate');
202
-        if (! empty($search)) {
202
+        if (!empty($search)) {
203 203
             if (config('nntmux.elasticsearch_enabled') === true) {
204 204
                 $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search);
205 205
             } else {
Please login to merge, or discard this patch.
app/Http/Controllers/CoverController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
         // Validate cover type
21 21
         $validTypes = ['anime', 'audio', 'audiosample', 'book', 'console', 'games', 'movies', 'music', 'preview', 'sample', 'tvrage', 'video', 'xxx', 'tvshows'];
22 22
 
23
-        if (! in_array($type, $validTypes)) {
23
+        if (!in_array($type, $validTypes)) {
24 24
             abort(404);
25 25
         }
26 26
 
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
         }
43 43
 
44 44
         // Check if file exists
45
-        if (! file_exists($filePath)) {
45
+        if (!file_exists($filePath)) {
46 46
             // Return placeholder image
47 47
             $placeholderPath = public_path('assets/images/no-cover.png');
48 48
             if (file_exists($placeholderPath)) {
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 // Get the default user role.
165 165
                 $userDefault = Role::query()->where('isdefault', '=', 1)->first();
166 166
 
167
-                if (! empty($error)) {
167
+                if (!empty($error)) {
168 168
                     return $this->showRegistrationForm($request, $error);
169 169
                 }
170 170
 
@@ -177,13 +177,13 @@  discard block
 block discarded – undo
177 177
                     $invitedBy = 0;
178 178
                     $invitation = null;
179 179
 
180
-                    if (! empty($inviteCode)) {
180
+                    if (!empty($inviteCode)) {
181 181
                         $invitation = Invitation::findValidByToken($inviteCode);
182 182
                         if ($invitation) {
183 183
                             $invitedBy = $invitation->invited_by;
184 184
 
185 185
                             // Validate email matches invitation
186
-                            if (! empty($invitation->email) && $invitation->email !== $email) {
186
+                            if (!empty($invitation->email) && $invitation->email !== $email) {
187 187
                                 $error = 'Email address does not match the invitation.';
188 188
 
189 189
                                 return $this->showRegistrationForm($request, $error);
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             case 'view':
238 238
                 // Don't set showRegister here - let showRegistrationForm handle it
239 239
                 // Only validate invite code if present
240
-                if (($inviteCode !== null) && ! $this->isInvitationTokenValid($inviteCode)) {
240
+                if (($inviteCode !== null) && !$this->isInvitationTokenValid($inviteCode)) {
241 241
                     $error = 'Invalid invitation token!';
242 242
                 }
243 243
                 break;
@@ -263,14 +263,14 @@  discard block
 block discarded – undo
263 263
         $emailFromInvite = '';
264 264
 
265 265
         if ((int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
266
-            if (! empty($inviteCode)) {
266
+            if (!empty($inviteCode)) {
267 267
                 if ($this->isInvitationTokenValid($inviteCode)) {
268 268
                     $error = '';
269 269
                     $showRegister = 1;
270 270
 
271 271
                     // Pre-fill email if invitation has one
272 272
                     $invitation = Invitation::findValidByToken($inviteCode);
273
-                    if ($invitation && ! empty($invitation->email)) {
273
+                    if ($invitation && !empty($invitation->email)) {
274 274
                         $emailFromInvite = $invitation->email;
275 275
                     }
276 276
                 } else {
@@ -311,12 +311,12 @@  discard block
 block discarded – undo
311 311
 
312 312
         $invitation = Invitation::findValidByToken($token);
313 313
 
314
-        if (! $invitation) {
314
+        if (!$invitation) {
315 315
             return false;
316 316
         }
317 317
 
318 318
         // If invitation has specific email, validate it matches
319
-        if (! empty($invitation->email) && $invitation->email !== $email) {
319
+        if (!empty($invitation->email) && $invitation->email !== $email) {
320 320
             return false;
321 321
         }
322 322
 
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         }
60 60
 
61 61
         // Check users exists and send an email
62
-        $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
62
+        $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
63 63
         if ($ret === null) {
64 64
             return view('auth.passwords.email')->withErrors(['error' => 'The email or apikey are not recognised.']);
65 65
         }
Please login to merge, or discard this patch.