Passed
Push — master ( fd803f...bf0d13 )
by Darko
08:24
created
app/Http/Controllers/Api/ApiV2Controller.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@
 block discarded – undo
51 51
                 'search' => ['available' => 'yes', 'supportedParams' => 'id'],
52 52
                 'tv-search' => ['available' => 'yes', 'supportedParams' => 'id,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'],
53 53
                 'movie-search' => ['available' => 'yes', 'supportedParams' => 'id, imdbid, tmdbid, traktid'],
54
-                'audio-search' => ['available' => 'no',  'supportedParams' => ''],
54
+                'audio-search' => ['available' => 'no', 'supportedParams' => ''],
55 55
             ],
56 56
             'categories' => fractal($category, new CategoryTransformer),
57 57
         ];
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiInformController.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -19,18 +19,18 @@
 block discarded – undo
19 19
      */
20 20
     public function release(Request $request): \Illuminate\Http\JsonResponse
21 21
     {
22
-        $releaseObName = $request->has('relo') && ! empty($request->input('relo')) ? $request->input('relo') : '';
23
-        $releasePrName = $request->has('relp') && ! empty($request->input('relp')) ? $request->input('relp') : '';
24
-        $apiToken = $request->has('api_token') && ! empty($request->input('api_token')) ? $request->input('api_token') : '';
22
+        $releaseObName = $request->has('relo') && !empty($request->input('relo')) ? $request->input('relo') : '';
23
+        $releasePrName = $request->has('relp') && !empty($request->input('relp')) ? $request->input('relp') : '';
24
+        $apiToken = $request->has('api_token') && !empty($request->input('api_token')) ? $request->input('api_token') : '';
25 25
         $user = User::query()->where('api_token', $request->input('api_token'))->first();
26
-        if (! $user) {
26
+        if (!$user) {
27 27
             return response()->json(['message' => 'Indexer inform error, wrong api key!'], 404);
28 28
         }
29 29
 
30
-        if (! empty($releaseObName) && ! empty($releasePrName) && ! empty($apiToken)) {
30
+        if (!empty($releaseObName) && !empty($releasePrName) && !empty($apiToken)) {
31 31
             ReleaseInform::insertOrIgnore(['relOName' => $releaseObName, 'relPName' => $releasePrName, 'api_token' => $apiToken, 'created_at' => now(), 'updated_at' => now()]);
32 32
             $release = Release::whereSearchname($releaseObName)->first();
33
-            if (! empty($release)) {
33
+            if (!empty($release)) {
34 34
                 (new NameFixer)->updateRelease($release, $releasePrName, 'Release Inform API', true, 'Filenames, ', 1, true);
35 35
             }
36 36
 
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
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
             return $predb;
197 197
         }
198 198
         $sql = self::query()->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate');
199
-        if (! empty($search)) {
199
+        if (!empty($search)) {
200 200
             if (config('nntmux.elasticsearch_enabled') === true) {
201 201
                 $ids = (new ElasticSearchSiteSearch)->predbIndexSearch($search);
202 202
             } else {
Please login to merge, or discard this patch.
app/Console/Commands/CleanNZB.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     public function handle(): void
38 38
     {
39 39
         // Check if any options are false
40
-        if (! $this->option('notindb') && ! $this->option('notondisk')) {
40
+        if (!$this->option('notindb') && !$this->option('notondisk')) {
41 41
             $this->error('You must specify at least one option. See: --help');
42 42
             exit();
43 43
         }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             $guid = stristr($filePath->getFilename(), '.nzb.gz', true);
64 64
             if (File::isFile($filePath) && $guid) {
65 65
                 // If NZB file guid is not present in DB delete the file from disk
66
-                if (! $releases->whereGuid($guid)->exists()) {
66
+                if (!$releases->whereGuid($guid)->exists()) {
67 67
                     if ($delete) {
68 68
                         File::delete($filePath);
69 69
                     }
@@ -88,11 +88,11 @@  discard block
 block discarded – undo
88 88
         $total = Release::count();
89 89
         $this->alert("Total releases to check: $total");
90 90
 
91
-        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function (Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
91
+        Release::where('nzbstatus', 1)->chunkById((int) $this->option('chunksize'), function(Collection $releases) use ($delete, &$checked, &$deleted, $nzb, $rel) {
92 92
             echo 'Total done: '.$checked."\r";
93 93
             foreach ($releases as $r) {
94 94
 
95
-                if (! $nzb->NZBPath($r->guid)) {
95
+                if (!$nzb->NZBPath($r->guid)) {
96 96
                     if ($delete) {
97 97
                         $rel->deleteSingle(['g' => $r->guid, 'i' => $r->id], $nzb, new ReleaseImage);
98 98
                     }
Please login to merge, or discard this patch.
app/Models/MovieInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -82,7 +82,7 @@
 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
             $sql->whereLike('title', '%'.$search.'%');
87 87
         }
88 88
 
Please login to merge, or discard this patch.
app/Providers/AppServiceProvider.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
         Paginator::useBootstrapFive();
21 21
         $smarty = app('smarty.view');
22 22
         view()->share('smarty', $smarty);
23
-        Gate::define('viewPulse', function (User $user) {
23
+        Gate::define('viewPulse', function(User $user) {
24 24
             return $user->hasRole('Admin');
25 25
         });
26 26
         Event::listen(Login::class, LoginViaRemember::class);
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/RegisterController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
                 // Get the default user role.
148 148
                 $userDefault = Role::query()->where('isdefault', '=', 1)->first();
149 149
 
150
-                if (! empty($error)) {
150
+                if (!empty($error)) {
151 151
                     return $this->showRegistrationForm($request, $error);
152 152
                 }
153 153
 
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
                 break;
171 171
             case 'view':
172 172
                 // See if it is a valid invite.
173
-                if (($inviteCode !== null) && ! Invite::isValid($inviteCode)) {
173
+                if (($inviteCode !== null) && !Invite::isValid($inviteCode)) {
174 174
                     $error = 'Invalid invitation token!';
175 175
                     $showRegister = 0;
176 176
                 } else {
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         }
203 203
 
204 204
         if ((int) Settings::settingValue('registerstatus') === Settings::REGISTER_STATUS_INVITE) {
205
-            if (! empty($inviteCode)) {
205
+            if (!empty($inviteCode)) {
206 206
                 if (Invite::isValid($inviteCode)) {
207 207
                     $error = '';
208 208
                     $showRegister = 1;
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdminSiteController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
         }
150 150
 
151 151
         // convert from a string array to an int array as we want to use int
152
-        $book_reqids_ids = array_map(function ($value) {
152
+        $book_reqids_ids = array_map(function($value) {
153 153
             return (int) $value;
154 154
         }, $book_reqids_ids);
155 155
         $this->smarty->assign('book_reqids_ids', $book_reqids_ids);
@@ -159,14 +159,14 @@  discard block
 block discarded – undo
159 159
         $books_selected = explode(',', Settings::settingValue('book_reqids'));
160 160
 
161 161
         // convert from a string array to an int array
162
-        $books_selected = array_map(function ($value) {
162
+        $books_selected = array_map(function($value) {
163 163
             return (int) $value;
164 164
         }, $books_selected);
165 165
         $this->smarty->assign('book_reqids_selected', $books_selected);
166 166
 
167 167
         $this->smarty->assign('themelist', Utility::getThemesList());
168 168
 
169
-        if (! str_contains(config('settings.nntp_server'), 'astra')) {
169
+        if (!str_contains(config('settings.nntp_server'), 'astra')) {
170 170
             $this->smarty->assign('compress_headers_warning', 'compress_headers_warning');
171 171
         }
172 172
 
Please login to merge, or discard this patch.
app/Http/Controllers/ProfileController.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         $privateProfiles = config('nntmux_settings.private_profiles');
32 32
         $publicView = false;
33 33
 
34
-        if ($privileged || ! $privateProfiles) {
34
+        if ($privileged || !$privateProfiles) {
35 35
             $altID = ($request->has('id') && (int) $request->input('id') >= 0) ? (int) $request->input('id') : false;
36 36
             $altUsername = ($request->has('name') && $request->input('name') !== '') ? $request->input('name') : false;
37 37
 
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         }
62 62
 
63 63
         // Check if the user selected a theme.
64
-        if (! isset($this->userdata->style) || $this->userdata->style === 'None') {
64
+        if (!isset($this->userdata->style) || $this->userdata->style === 'None') {
65 65
             $this->userdata->style = 'Using the admin selected theme.';
66 66
         }
67 67
         $this->smarty->assign(
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $action = $request->input('action') ?? 'view';
113 113
 
114 114
         $userid = $this->userdata->id;
115
-        if (! $this->userdata) {
115
+        if (!$this->userdata) {
116 116
             $this->show404('No such user!');
117 117
         }
118 118
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                         'None',
152 152
                     );
153 153
 
154
-                    if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && ! $this->userdata->hasDirectPermission('view console')) {
154
+                    if ((int) $request->input('viewconsole') === 1 && $this->userdata->can('view console') && !$this->userdata->hasDirectPermission('view console')) {
155 155
                         $this->userdata->givePermissionTo('view console');
156 156
                     } elseif ((int) $request->input('viewconsole') === 0 && $this->userdata->can('view console') && $this->userdata->hasDirectPermission('view console')) {
157 157
                         $this->userdata->revokePermissionTo('view console');
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
                         $this->userdata->revokePermissionTo('view console');
160 160
                     }
161 161
 
162
-                    if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && ! $this->userdata->hasDirectPermission('view movies')) {
162
+                    if ((int) $request->input('viewmovies') === 1 && $this->userdata->can('view movies') && !$this->userdata->hasDirectPermission('view movies')) {
163 163
                         $this->userdata->givePermissionTo('view movies');
164 164
                     } elseif ((int) $request->input('viewmovies') === 0 && $this->userdata->can('view movies') && $this->userdata->hasDirectPermission('view movies')) {
165 165
                         $this->userdata->revokePermissionTo('view movies');
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
                         $this->userdata->revokePermissionTo('view movies');
168 168
                     }
169 169
 
170
-                    if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && ! $this->userdata->hasDirectPermission('view audio')) {
170
+                    if ((int) $request->input('viewaudio') === 1 && $this->userdata->can('view audio') && !$this->userdata->hasDirectPermission('view audio')) {
171 171
                         $this->userdata->givePermissionTo('view audio');
172 172
                     } elseif ((int) $request->input('viewaudio') === 0 && $this->userdata->can('view audio') && $this->userdata->hasDirectPermission('view audio')) {
173 173
                         $this->userdata->revokePermissionTo('view audio');
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
175 175
                         $this->userdata->revokePermissionTo('view audio');
176 176
                     }
177 177
 
178
-                    if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && ! $this->userdata->hasDirectPermission('view pc')) {
178
+                    if ((int) $request->input('viewpc') === 1 && $this->userdata->can('view pc') && !$this->userdata->hasDirectPermission('view pc')) {
179 179
                         $this->userdata->givePermissionTo('view pc');
180 180
                     } elseif ((int) $request->input('viewpc') === 0 && $this->userdata->can('view pc') && $this->userdata->hasDirectPermission('view pc')) {
181 181
                         $this->userdata->revokePermissionTo('view pc');
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
                         $this->userdata->revokePermissionTo('view pc');
184 184
                     }
185 185
 
186
-                    if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && ! $this->userdata->hasDirectPermission('view tv')) {
186
+                    if ((int) $request->input('viewtv') === 1 && $this->userdata->can('view tv') && !$this->userdata->hasDirectPermission('view tv')) {
187 187
                         $this->userdata->givePermissionTo('view tv');
188 188
                     } elseif ((int) $request->input('viewtv') === 0 && $this->userdata->can('view tv') && $this->userdata->hasDirectPermission('view tv')) {
189 189
                         $this->userdata->revokePermissionTo('view tv');
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
                         $this->userdata->revokePermissionTo('view tv');
192 192
                     }
193 193
 
194
-                    if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && ! $this->userdata->hasDirectPermission('view adult')) {
194
+                    if ((int) $request->input('viewadult') === 1 && $this->userdata->can('view adult') && !$this->userdata->hasDirectPermission('view adult')) {
195 195
                         $this->userdata->givePermissionTo('view adult');
196 196
                     } elseif ((int) $request->input('viewadult') === 0 && $this->userdata->can('view adult') && $this->userdata->hasDirectPermission('view adult')) {
197 197
                         $this->userdata->revokePermissionTo('view adult');
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                         $this->userdata->revokePermissionTo('view adult');
200 200
                     }
201 201
 
202
-                    if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && ! $this->userdata->hasDirectPermission('view books')) {
202
+                    if ((int) $request->input('viewbooks') === 1 && $this->userdata->can('view books') && !$this->userdata->hasDirectPermission('view books')) {
203 203
                         $this->userdata->givePermissionTo('view books');
204 204
                     } elseif ((int) $request->input('viewbooks') === 0 && $this->userdata->can('view books') && $this->userdata->hasDirectPermission('view books')) {
205 205
                         $this->userdata->revokePermissionTo('view books');
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
                         $this->userdata->revokePermissionTo('view books');
208 208
                     }
209 209
 
210
-                    if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && ! $this->userdata->hasDirectPermission('view other')) {
210
+                    if ((int) $request->input('viewother') === 1 && $this->userdata->can('view other') && !$this->userdata->hasDirectPermission('view other')) {
211 211
                         $this->userdata->givePermissionTo('view other');
212 212
                     } elseif ((int) $request->input('viewother') === 0 && $this->userdata->can('view other') && $this->userdata->hasDirectPermission('view other')) {
213 213
                         $this->userdata->revokePermissionTo('view other');
@@ -215,12 +215,12 @@  discard block
 block discarded – undo
215 215
                         $this->userdata->revokePermissionTo('view other');
216 216
                     }
217 217
 
218
-                    if ($request->has('password') && ! empty($request->input('password'))) {
218
+                    if ($request->has('password') && !empty($request->input('password'))) {
219 219
                         User::updatePassword($userid, $request->input('password'));
220 220
                     }
221 221
 
222
-                    if (! $this->userdata->hasRole('Admin')) {
223
-                        if (! empty($request->input('email')) && $this->userdata->email !== $request->input('email')) {
222
+                    if (!$this->userdata->hasRole('Admin')) {
223
+                        if (!empty($request->input('email')) && $this->userdata->email !== $request->input('email')) {
224 224
                             $this->userdata->email = $request->input('email');
225 225
 
226 226
                             $verify_user = $this->userdata;
@@ -269,7 +269,7 @@  discard block
 block discarded – undo
269 269
         $this->setPreferences();
270 270
         $userId = $request->input('id');
271 271
 
272
-        if ($userId !== null && (int) $userId === $this->userdata->id && ! $this->userdata->hasRole('Admin')) {
272
+        if ($userId !== null && (int) $userId === $this->userdata->id && !$this->userdata->hasRole('Admin')) {
273 273
             $user = User::find($userId);
274 274
             SendAccountDeletedEmail::dispatch($user);
275 275
             Auth::logout();
Please login to merge, or discard this patch.