Passed
Push — master ( d53954...57205f )
by Darko
12:06
created
app/Http/Controllers/ContactUsController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@
 block discarded – undo
30 30
                 }
31 31
             }
32 32
 
33
-            if (! preg_match("/\n/i", $request->input('useremail'))) {
33
+            if (!preg_match("/\n/i", $request->input('useremail'))) {
34 34
                 SendContactUsEmail::dispatch($email, $mailTo, $mailBody)->onQueue('contactemail');
35 35
             }
36 36
             $msg = "<h2 style='text-align:center;'>Thank you for getting in touch with ".config('app.name').'.</h2>';
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         $releases = new Releases;
124 124
 
125 125
         // Set Query Parameters based on Request objects
126
-        $outputXML = ! ($request->has('o') && $request->input('o') === 'json');
126
+        $outputXML = !($request->has('o') && $request->input('o') === 'json');
127 127
         $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0;
128 128
         $offset = $this->offset($request);
129 129
 
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 
265 265
                 $this->addCoverURL(
266 266
                     $relData,
267
-                    function ($release) {
267
+                    function($release) {
268 268
                         return Utility::getCoverURL(['type' => 'movies', 'id' => $release->imdbid]);
269 269
                     }
270 270
                 );
@@ -306,9 +306,9 @@  discard block
 block discarded – undo
306 306
 
307 307
                 if ($rel && $rel->isNotEmpty()) {
308 308
                     $data = ReleaseNfo::getReleaseNfo($rel->id);
309
-                    if (! empty($data)) {
309
+                    if (!empty($data)) {
310 310
                         if ($request->has('o') && $request->input('o') === 'file') {
311
-                            return response()->streamDownload(function () use ($data) {
311
+                            return response()->streamDownload(function() use ($data) {
312 312
                                 echo $data['nfo'];
313 313
                             }, $rel['searchname'].'.nfo', ['Content-type:' => 'application/octet-stream']);
314 314
                         }
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
                 // curl -X POST -F "file=@./The.File.nzb" "https://www.tabula-rasa.pw/api/V1/api?t=nzbadd&apikey=xxx"
327 327
                 //
328 328
             case 'nzbAdd':
329
-                if (! User::canPost($uid)) {
329
+                if (!User::canPost($uid)) {
330 330
                     return response('User does not have permission to post', 403);
331 331
                 }
332 332
 
@@ -337,7 +337,7 @@  discard block
 block discarded – undo
337 337
                     return response('Missing parameter (apikey is required for adding an NZB)', 400);
338 338
                 }
339 339
 
340
-                if (! $request->hasFile('file')) {
340
+                if (!$request->hasFile('file')) {
341 341
                     return response('Missing parameter (file is required for adding an NZB)', 400);
342 342
                 }
343 343
 
@@ -352,10 +352,10 @@  discard block
 block discarded – undo
352 352
                         return response('File is not an NZB file', 400);
353 353
                     }
354 354
                     // Check if the file is proper xml nzb file.
355
-                    if (! Utility::isValidNewznabNzb($nzbFile->getContent())) {
355
+                    if (!Utility::isValidNewznabNzb($nzbFile->getContent())) {
356 356
                         return response('File is not a valid Newznab NZB file', 400);
357 357
                     }
358
-                    if (! File::isDirectory(config('nntmux.nzb_upload_folder'))) {
358
+                    if (!File::isDirectory(config('nntmux.nzb_upload_folder'))) {
359 359
                         @File::makeDirectory(config('nntmux.nzb_upload_folder'), 0775, true);
360 360
                     }
361 361
 
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
             header('Content-type: text/xml');
403 403
         } else {
404 404
             // JSON encode the XMLWriter response
405
-            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
405
+            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR|JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
406 406
             header('Content-type: application/json');
407 407
         }
408 408
         if ($response === false) {
@@ -445,7 +445,7 @@  discard block
 block discarded – undo
445 445
                 'search' => ['available' => 'yes', 'supportedParams' => 'q'],
446 446
                 'tv-search' => ['available' => 'yes', 'supportedParams' => 'q,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'],
447 447
                 'movie-search' => ['available' => 'yes', 'supportedParams' => 'q,imdbid, tmdbid, traktid'],
448
-                'audio-search' => ['available' => 'no',  'supportedParams' => ''],
448
+                'audio-search' => ['available' => 'no', 'supportedParams' => ''],
449 449
             ],
450 450
             'categories' => $this->type === 'caps'
451 451
                 ? Category::getForMenu()
@@ -460,9 +460,9 @@  discard block
 block discarded – undo
460 460
     {
461 461
         $maxAge = -1;
462 462
         if ($request->has('maxage')) {
463
-            if (! $request->filled('maxage')) {
463
+            if (!$request->filled('maxage')) {
464 464
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must not be empty)');
465
-            } elseif (! is_numeric($request->input('maxage'))) {
465
+            } elseif (!is_numeric($request->input('maxage'))) {
466 466
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must be numeric)');
467 467
             } else {
468 468
                 $maxAge = (int) $request->input('maxage');
@@ -481,7 +481,7 @@  discard block
 block discarded – undo
481 481
         if ($request->has('cat')) {
482 482
             $categoryIDs = urldecode($request->input('cat'));
483 483
             // Append Web-DL category ID if HD present for SickBeard / Sonarr compatibility.
484
-            if (str_contains($categoryIDs, (string) Category::TV_HD) && ! str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
484
+            if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
485 485
                 $categoryIDs .= (','.Category::TV_WEBDL);
486 486
             }
487 487
             $categoryID = explode(',', $categoryIDs);
Please login to merge, or discard this patch.
app/Models/Release.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
151 151
     {
152 152
         $movieInfoId = null;
153
-        if (! empty($imDbId)) {
153
+        if (!empty($imDbId)) {
154 154
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
155 155
         }
156 156
         self::whereId($id)->update(
@@ -341,7 +341,7 @@  discard block
 block discarded – undo
341 341
 
342 342
         $releases = $query->get();
343 343
 
344
-        $releases->each(function ($release) {
344
+        $releases->each(function($release) {
345 345
             $release->group_name = $release->group->name ?? null;
346 346
             $release->showtitle = $release->video->title ?? null;
347 347
             $release->tvdb = $release->video->tvdb ?? null;
@@ -358,7 +358,7 @@  discard block
 block discarded – undo
358 358
             $release->sub_category = $release->category->title ?? null;
359 359
             $release->category_name = $release->parent_category.' > '.$release->sub_category;
360 360
             $release->category_ids = $release->category ? ($release->category->parentid.','.$release->category->id) : '';
361
-            $release->group_names = $release->releaseGroup->map(function ($relGroup) {
361
+            $release->group_names = $release->releaseGroup->map(function($relGroup) {
362 362
                 return $relGroup->group ? $relGroup->group->name : null;
363 363
             })->implode(',');
364 364
         });
@@ -395,12 +395,12 @@  discard block
 block discarded – undo
395 395
 
396 396
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
397 397
 
398
-        if (! empty($similar)) {
398
+        if (!empty($similar)) {
399 399
             if (config('nntmux.elasticsearch_enabled') === true) {
400 400
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
401 401
             } else {
402 402
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
403
-                if (! empty($searchResult)) {
403
+                if (!empty($searchResult)) {
404 404
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
405 405
                 }
406 406
             }
Please login to merge, or discard this patch.
app/Console/Commands/NntmuxResetPostProcessing.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
     {
54 54
 
55 55
         // Allow resetting categories only if environment is local and category is 'misc'
56
-        if (app()->environment() !== 'local' && ((isset($this->option('category')['0']) && $this->option('category')[0] !== 'misc') || ! isset($this->option('category')['0']))) {
56
+        if (app()->environment() !== 'local' && ((isset($this->option('category')['0']) && $this->option('category')[0] !== 'misc') || !isset($this->option('category')['0']))) {
57 57
             $this->error('This command can only be run in local environment');
58 58
 
59 59
             return;
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
 
101 101
             // Validate
102 102
             $invalid = $this->invalidCategories($normalized);
103
-            if (! empty($invalid)) {
103
+            if (!empty($invalid)) {
104 104
                 $this->error('Unknown category option(s): '.implode(', ', $invalid));
105 105
                 $this->line('Allowed: '.implode(', ', self::$allowedCategories).' (or omit --category to reset all).');
106 106
 
@@ -158,12 +158,12 @@  discard block
 block discarded – undo
158 158
     private function normalizeCategories(array $raw): array
159 159
     {
160 160
         $normalized = collect($raw)
161
-            ->flatMap(function ($opt) {
161
+            ->flatMap(function($opt) {
162 162
                 $opt = is_array($opt) ? implode(',', $opt) : (string) $opt;
163 163
 
164 164
                 return preg_split('/[\s,]+/', $opt, -1, PREG_SPLIT_NO_EMPTY);
165 165
             })
166
-            ->map(function ($opt) {
166
+            ->map(function($opt) {
167 167
                 $opt = trim((string) $opt);
168 168
                 // If the token contains '=', take the substring after the last '='
169 169
                 if (str_contains($opt, '=')) {
@@ -194,7 +194,7 @@  discard block
 block discarded – undo
194 194
     private function invalidCategories(array $normalized): array
195 195
     {
196 196
         return collect($normalized)
197
-            ->reject(function ($opt) {
197
+            ->reject(function($opt) {
198 198
                 return in_array($opt, self::$allowedCategories, true) || $opt === 'all';
199 199
             })
200 200
             ->values()
Please login to merge, or discard this patch.
app/Console/Commands/FindSizeMismatchedReleases.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         $mismatches = $query->get();
60 60
 
61 61
         if ($checkSeasonPack) {
62
-            $mismatches = $mismatches->filter(function ($release) use ($nameFixer) {
62
+            $mismatches = $mismatches->filter(function($release) use ($nameFixer) {
63 63
                 return $nameFixer->isSeasonPack($release->name);
64 64
             });
65 65
         }
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 
86 86
         // Regular table output for non-rename mode
87 87
         $headers = ['Release ID', 'Searchname', 'Release Size', 'Files Total', 'Difference', 'Diff %'];
88
-        $rows = $mismatches->map(function ($release) {
88
+        $rows = $mismatches->map(function($release) {
89 89
             return [
90 90
                 $release->id,
91 91
                 $release->searchname,
Please login to merge, or discard this patch.
app/Console/Commands/CaptchaStatus.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
         $recaptchaSecret = config('captcha.recaptcha.secret');
41 41
 
42 42
         $this->line('  Enabled: '.($recaptchaEnabled ? '<fg=green>Yes</>' : '<fg=red>No</>'));
43
-        $this->line('  Site Key: '.(! empty($recaptchaSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
44
-        $this->line('  Secret: '.(! empty($recaptchaSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
43
+        $this->line('  Site Key: '.(!empty($recaptchaSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
44
+        $this->line('  Secret: '.(!empty($recaptchaSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
45 45
         $this->newLine();
46 46
 
47 47
         // Check Turnstile
@@ -51,13 +51,13 @@  discard block
 block discarded – undo
51 51
         $turnstileSecret = config('captcha.turnstile.secret');
52 52
 
53 53
         $this->line('  Enabled: '.($turnstileEnabled ? '<fg=green>Yes</>' : '<fg=red>No</>'));
54
-        $this->line('  Site Key: '.(! empty($turnstileSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
55
-        $this->line('  Secret: '.(! empty($turnstileSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
54
+        $this->line('  Site Key: '.(!empty($turnstileSitekey) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
55
+        $this->line('  Secret: '.(!empty($turnstileSecret) ? '<fg=green>Configured</>' : '<fg=red>Missing</>'));
56 56
         $this->newLine();
57 57
 
58 58
         // Validation
59
-        $recaptchaReady = $recaptchaEnabled && ! empty($recaptchaSitekey) && ! empty($recaptchaSecret);
60
-        $turnstileReady = $turnstileEnabled && ! empty($turnstileSitekey) && ! empty($turnstileSecret);
59
+        $recaptchaReady = $recaptchaEnabled && !empty($recaptchaSitekey) && !empty($recaptchaSecret);
60
+        $turnstileReady = $turnstileEnabled && !empty($turnstileSitekey) && !empty($turnstileSecret);
61 61
 
62 62
         if ($recaptchaReady && $turnstileReady) {
63 63
             $this->error('⚠ WARNING: Both providers are enabled!');
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
             $this->info('✓ reCAPTCHA is properly configured and active');
71 71
         } elseif ($provider === 'turnstile' && $turnstileReady) {
72 72
             $this->info('✓ Turnstile is properly configured and active');
73
-        } elseif ($provider === 'recaptcha' && ! $recaptchaReady) {
73
+        } elseif ($provider === 'recaptcha' && !$recaptchaReady) {
74 74
             $this->error('✗ reCAPTCHA is selected but not properly configured');
75
-        } elseif ($provider === 'turnstile' && ! $turnstileReady) {
75
+        } elseif ($provider === 'turnstile' && !$turnstileReady) {
76 76
             $this->error('✗ Turnstile is selected but not properly configured');
77 77
         } else {
78 78
             $this->warn('⚠ No CAPTCHA provider is active');
Please login to merge, or discard this patch.
app/Services/SystemMetricsService.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
             $hourKey = $metric->recorded_at->format('Y-m-d H:00');
51 51
             $hourLabel = $metric->recorded_at->format('H:i');
52 52
 
53
-            if (! isset($hourlyData[$hourKey])) {
53
+            if (!isset($hourlyData[$hourKey])) {
54 54
                 $hourlyData[$hourKey] = [
55 55
                     'time' => $hourLabel,
56 56
                     'values' => [],
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             $dayKey = $metric->recorded_at->format('Y-m-d');
91 91
             $dayLabel = $metric->recorded_at->format('M d');
92 92
 
93
-            if (! isset($dailyData[$dayKey])) {
93
+            if (!isset($dailyData[$dayKey])) {
94 94
                 $dailyData[$dayKey] = [
95 95
                     'time' => $dayLabel,
96 96
                     'values' => [],
Please login to merge, or discard this patch.
app/Rules/TurnstileRule.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@
 block discarded – undo
19 19
             return;
20 20
         }
21 21
 
22
-        if (! TurnstileService::verify($value)) {
22
+        if (!TurnstileService::verify($value)) {
23 23
             $fail('The captcha verification failed. Please try again.');
24 24
         }
25 25
     }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/AdminPageController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             ->limit(10)
57 57
             ->get();
58 58
 
59
-        return $activities->map(function ($activity) {
59
+        return $activities->map(function($activity) {
60 60
             return (object) [
61 61
                 'type' => $activity->activity_type,
62 62
                 'message' => $activity->description,
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 
79 79
         return response()->json([
80 80
             'success' => true,
81
-            'activities' => array_map(function ($activity) {
81
+            'activities' => array_map(function($activity) {
82 82
                 return [
83 83
                     'type' => $activity->type,
84 84
                     'message' => $activity->message,
@@ -265,7 +265,7 @@  discard block
 block discarded – undo
265 265
 
266 266
                 // Get number of physical cores
267 267
                 preg_match_all('/^cpu cores\s*:\s*(\d+)/m', $cpuinfo, $coresMatches);
268
-                if (! empty($coresMatches[1])) {
268
+                if (!empty($coresMatches[1])) {
269 269
                     $info['cores'] = (int) $coresMatches[1][0];
270 270
                 }
271 271
 
@@ -275,14 +275,14 @@  discard block
 block discarded – undo
275 275
 
276 276
                 // Get CPU model
277 277
                 preg_match('/^model name\s*:\s*(.+)$/m', $cpuinfo, $modelMatches);
278
-                if (! empty($modelMatches[1])) {
278
+                if (!empty($modelMatches[1])) {
279 279
                     $info['model'] = trim($modelMatches[1]);
280 280
                 }
281 281
 
282 282
                 // If cores is 0, try to get from physical id count
283 283
                 if ($info['cores'] === 0) {
284 284
                     preg_match_all('/^physical id\s*:\s*(\d+)/m', $cpuinfo, $physicalMatches);
285
-                    $uniquePhysical = ! empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1;
285
+                    $uniquePhysical = !empty($physicalMatches[1]) ? count(array_unique($physicalMatches[1])) : 1;
286 286
                     $info['cores'] = (int) ($info['threads'] / $uniquePhysical);
287 287
                 }
288 288
             }
Please login to merge, or discard this patch.