Passed
Push — master ( fd803f...bf0d13 )
by Darko
08:24
created
app/Http/Controllers/Auth/LoginController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@
 block discarded – undo
73 73
             if ($user !== null) {
74 74
                 $rememberMe = $request->has('rememberme') && $request->input('rememberme') === 'on';
75 75
 
76
-                if (! $user->isVerified() || $user->isPendingVerification()) {
76
+                if (!$user->isVerified() || $user->isPendingVerification()) {
77 77
                     $request->session()->flash('message', 'You have not verified your email address!');
78 78
 
79 79
                     return redirect()->to('login');
Please login to merge, or discard this patch.
app/Http/Controllers/DetailsController.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,11 +34,11 @@  discard block
 block discarded – undo
34 34
             $re = new ReleaseExtra;
35 35
             $data = Release::getByGuid($guid);
36 36
             $releaseRegex = '';
37
-            if (! empty($data)) {
37
+            if (!empty($data)) {
38 38
                 $releaseRegex = ReleaseRegex::query()->where('releases_id', '=', $data['id'])->first();
39 39
             }
40 40
 
41
-            if (! $data) {
41
+            if (!$data) {
42 42
                 return redirect()->back();
43 43
             }
44 44
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
             if ($data['imdbid'] !== '' && $data['imdbid'] !== 0000000) {
65 65
                 $movie = new Movie(['Settings' => $this->settings]);
66 66
                 $mov = $movie->getMovieInfo($data['imdbid']);
67
-                if (! empty($mov['title'])) {
67
+                if (!empty($mov['title'])) {
68 68
                     $mov['title'] = str_replace(['/', '\\'], '', $mov['title']);
69 69
                     $mov['actors'] = makeFieldLinks($mov, 'actors', 'movies');
70 70
                     $mov['genre'] = makeFieldLinks($mov, 'genre', 'movies');
Please login to merge, or discard this patch.
app/Http/Controllers/MyShowsController.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
         switch ($action) {
27 27
             case 'delete':
28 28
                 $show = UserSerie::getShow($this->userdata->id, $videoId);
29
-                if (! $show) {
29
+                if (!$show) {
30 30
                     return redirect()->back();
31 31
                 }
32 32
 
@@ -46,12 +46,12 @@  discard block
 block discarded – undo
46 46
                 }
47 47
 
48 48
                 $show = Video::getByVideoID($videoId);
49
-                if (! $show) {
49
+                if (!$show) {
50 50
                     return redirect()->to('myshows');
51 51
                 }
52 52
 
53 53
                 if ($action === 'doadd') {
54
-                    $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : [];
54
+                    $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : [];
55 55
                     UserSerie::addShow($this->userdata->id, $videoId, $category);
56 56
                     if ($request->has('from')) {
57 57
                         return redirect()->to($request->input('from'));
@@ -85,12 +85,12 @@  discard block
 block discarded – undo
85 85
             case 'doedit':
86 86
                 $show = UserSerie::getShow($this->userdata->id, $videoId);
87 87
 
88
-                if (! $show) {
88
+                if (!$show) {
89 89
                     return redirect()->to('myshows');
90 90
                 }
91 91
 
92 92
                 if ($action === 'doedit') {
93
-                    $category = ($request->has('category') && \is_array($request->input('category')) && ! empty($request->input('category'))) ? $request->input('category') : [];
93
+                    $category = ($request->has('category') && \is_array($request->input('category')) && !empty($request->input('category'))) ? $request->input('category') : [];
94 94
                     UserSerie::updateShow($this->userdata->id, $videoId, $category);
95 95
                     if ($request->has('from')) {
96 96
                         return redirect()->to($request->input('from'));
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
                 if ($shows !== null) {
137 137
                     foreach ($shows as $showk => $show) {
138 138
                         $showcats = explode('|', $show['categories']);
139
-                        if (\is_array($showcats) && ! empty($showcats)) {
139
+                        if (\is_array($showcats) && !empty($showcats)) {
140 140
                             foreach ($showcats as $scat) {
141
-                                if (! empty($scat)) {
141
+                                if (!empty($scat)) {
142 142
                                     $catArr[] = $categories[$scat];
143 143
                                 }
144 144
                             }
Please login to merge, or discard this patch.
app/Http/Controllers/BtcPaymentController.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@
 block discarded – undo
57 57
 
58 58
         if ($payload['type'] === 'InvoiceSettled') {
59 59
             // Check if we have the invoice_id in payments table and if we do, update the user account
60
-            $checkOrder = Payment::query()->where('invoice_id', '=', $payload['invoiceId'])->where('payment_status', '=', 'Settled')->where(function ($query) {
60
+            $checkOrder = Payment::query()->where('invoice_id', '=', $payload['invoiceId'])->where('payment_status', '=', 'Settled')->where(function($query) {
61 61
                 return $query->where('invoice_status', 'Pending')->orWhereNull('invoice_status');
62 62
             })->first();
63 63
             if ($checkOrder !== null) {
Please login to merge, or discard this patch.
app/Http/Controllers/GetNzbController.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             }
35 35
 
36 36
             $res = User::getByRssToken($request->input('r'));
37
-            if (! $res) {
37
+            if (!$res) {
38 38
                 return Utility::showApiError(100);
39 39
             }
40 40
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             return Utility::showApiError(501);
53 53
         }
54 54
 
55
-        if (! $request->input('id')) {
55
+        if (!$request->input('id')) {
56 56
             return Utility::showApiError(200, 'Parameter id is required');
57 57
         }
58 58
 
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         $nzbPath = (new NZB)->getNZBPath($request->input('id'));
88 88
 
89
-        if (! File::exists($nzbPath)) {
89
+        if (!File::exists($nzbPath)) {
90 90
             return Utility::showApiError(300, 'NZB file not found!');
91 91
         }
92 92
 
@@ -113,9 +113,9 @@  discard block
 block discarded – undo
113 113
             'X-DNZB-Details' => url('/details/'.$request->input('id')),
114 114
         ];
115 115
 
116
-        if (! empty($relData['imdbid']) && $relData['imdbid'] > 0) {
116
+        if (!empty($relData['imdbid']) && $relData['imdbid'] > 0) {
117 117
             $headers['X-DNZB-MoreInfo'] = 'http://www.imdb.com/title/tt'.$relData['imdbid'];
118
-        } elseif (! empty($relData['tvdb']) && $relData['tvdb'] > 0) {
118
+        } elseif (!empty($relData['tvdb']) && $relData['tvdb'] > 0) {
119 119
             $headers['X-DNZB-MoreInfo'] = 'http://www.thetvdb.com/?tab=series&id='.$relData['tvdb'];
120 120
         }
121 121
 
@@ -130,15 +130,15 @@  discard block
 block discarded – undo
130 130
         $cleanName = str_replace([',', ' ', '/', '\\'], '_', $relData['searchname']);
131 131
 
132 132
         // Stream the file content
133
-        return response()->streamDownload(function () use ($nzbPath) {
133
+        return response()->streamDownload(function() use ($nzbPath) {
134 134
             $bufferSize = 1000000; // 1 MB chunks
135 135
             $gz = gzopen($nzbPath, 'rb');
136 136
 
137
-            if (! $gz) {
137
+            if (!$gz) {
138 138
                 throw new RuntimeException('Failed to open gzipped file for streaming.');
139 139
             }
140 140
 
141
-            while (! gzeof($gz)) {
141
+            while (!gzeof($gz)) {
142 142
                 echo gzread($gz, $bufferSize);
143 143
                 flush(); // Ensure chunks are sent immediately
144 144
             }
Please login to merge, or discard this patch.
app/Http/Controllers/Api/ApiController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
         $releases = new Releases;
118 118
 
119 119
         // Set Query Parameters based on Request objects
120
-        $outputXML = ! ($request->has('o') && $request->input('o') === 'json');
120
+        $outputXML = !($request->has('o') && $request->input('o') === 'json');
121 121
         $minSize = $request->has('minsize') && $request->input('minsize') > 0 ? $request->input('minsize') : 0;
122 122
         $offset = $this->offset($request);
123 123
 
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 
259 259
                 $this->addCoverURL(
260 260
                     $relData,
261
-                    function ($release) {
261
+                    function($release) {
262 262
                         return Utility::getCoverURL(['type' => 'movies', 'id' => $release->imdbid]);
263 263
                     }
264 264
                 );
@@ -300,9 +300,9 @@  discard block
 block discarded – undo
300 300
 
301 301
                 if ($rel && $rel->isNotEmpty()) {
302 302
                     $data = ReleaseNfo::getReleaseNfo($rel->id);
303
-                    if (! empty($data)) {
303
+                    if (!empty($data)) {
304 304
                         if ($request->has('o') && $request->input('o') === 'file') {
305
-                            return response()->streamDownload(function () use ($data) {
305
+                            return response()->streamDownload(function() use ($data) {
306 306
                                 echo $data['nfo'];
307 307
                             }, $rel['searchname'].'.nfo', ['Content-type:' => 'application/octet-stream']);
308 308
                         }
@@ -344,7 +344,7 @@  discard block
 block discarded – undo
344 344
             header('Content-type: text/xml');
345 345
         } else {
346 346
             // JSON encode the XMLWriter response
347
-            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR | JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
347
+            $response = json_encode(xml_to_array($response), JSON_THROW_ON_ERROR|JSON_PRETTY_PRINT + JSON_UNESCAPED_SLASHES);
348 348
             header('Content-type: application/json');
349 349
         }
350 350
         if ($response === false) {
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
                 'search' => ['available' => 'yes', 'supportedParams' => 'q'],
388 388
                 'tv-search' => ['available' => 'yes', 'supportedParams' => 'q,vid,tvdbid,traktid,rid,tvmazeid,imdbid,tmdbid,season,ep'],
389 389
                 'movie-search' => ['available' => 'yes', 'supportedParams' => 'q,imdbid, tmdbid, traktid'],
390
-                'audio-search' => ['available' => 'no',  'supportedParams' => ''],
390
+                'audio-search' => ['available' => 'no', 'supportedParams' => ''],
391 391
             ],
392 392
             'categories' => $this->type === 'caps'
393 393
                 ? Category::getForMenu()
@@ -402,9 +402,9 @@  discard block
 block discarded – undo
402 402
     {
403 403
         $maxAge = -1;
404 404
         if ($request->has('maxage')) {
405
-            if (! $request->filled('maxage')) {
405
+            if (!$request->filled('maxage')) {
406 406
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must not be empty)');
407
-            } elseif (! is_numeric($request->input('maxage'))) {
407
+            } elseif (!is_numeric($request->input('maxage'))) {
408 408
                 return Utility::showApiError(201, 'Incorrect parameter (maxage must be numeric)');
409 409
             } else {
410 410
                 $maxAge = (int) $request->input('maxage');
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
         if ($request->has('cat')) {
424 424
             $categoryIDs = urldecode($request->input('cat'));
425 425
             // Append Web-DL category ID if HD present for SickBeard / Sonarr compatibility.
426
-            if (str_contains($categoryIDs, (string) Category::TV_HD) && ! str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
426
+            if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('catwebdl') === 0) {
427 427
                 $categoryIDs .= (','.Category::TV_WEBDL);
428 428
             }
429 429
             $categoryID = explode(',', $categoryIDs);
Please login to merge, or discard this patch.
app/Console/Commands/InstallNntmux.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -53,8 +53,8 @@  discard block
 block discarded – undo
53 53
             }
54 54
         }
55 55
 
56
-        if (! $yesMode) {
57
-            if (! $this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) {
56
+        if (!$yesMode) {
57
+            if (!$this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) {
58 58
                 $this->info('Installation aborted by user.');
59 59
                 exit;
60 60
             }
@@ -97,33 +97,33 @@  discard block
 block discarded – undo
97 97
         $zip_path = config('nntmux_settings.tmp_unzip_path');
98 98
         $unrar_path = config('nntmux.tmp_unrar_path');
99 99
 
100
-        if (! File::isWritable($nzb_path)) {
100
+        if (!File::isWritable($nzb_path)) {
101 101
             $this->warn($nzb_path.' is not writable. Please fix folder permissions');
102 102
 
103 103
             return false;
104 104
         }
105 105
 
106
-        if (! file_exists($unrar_path)) {
106
+        if (!file_exists($unrar_path)) {
107 107
             $this->info('Creating missing '.$unrar_path.' folder');
108
-            if (! @File::makeDirectory($unrar_path) && ! File::isDirectory($unrar_path)) {
108
+            if (!@File::makeDirectory($unrar_path) && !File::isDirectory($unrar_path)) {
109 109
                 throw new \RuntimeException('Unable to create '.$unrar_path.' folder');
110 110
             }
111 111
             $this->info('Folder '.$unrar_path.' successfully created');
112 112
         }
113 113
 
114
-        if (! is_writable($unrar_path)) {
114
+        if (!is_writable($unrar_path)) {
115 115
             $this->warn($unrar_path.' is not writable. Please fix folder permissions');
116 116
 
117 117
             return false;
118 118
         }
119 119
 
120
-        if (! File::isWritable($covers_path)) {
120
+        if (!File::isWritable($covers_path)) {
121 121
             $this->warn($covers_path.' is not writable. Please fix folder permissions');
122 122
 
123 123
             return false;
124 124
         }
125 125
 
126
-        if (! File::isWritable($zip_path)) {
126
+        if (!File::isWritable($zip_path)) {
127 127
             $this->warn($zip_path.' is not writable. Please fix folder permissions');
128 128
 
129 129
             return false;
Please login to merge, or discard this patch.
app/Http/Controllers/Auth/ForgotPasswordController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         if (empty($email) && empty($rssToken)) {
44 44
             app('smarty.view')->assign('error', 'Missing parameter (email and/or apikey) to send password reset');
45 45
         } else {
46
-            if (config('captcha.enabled') === true && (! empty(config('captcha.secret')) && ! empty(config('captcha.sitekey')))) {
46
+            if (config('captcha.enabled') === true && (!empty(config('captcha.secret')) && !empty(config('captcha.sitekey')))) {
47 47
                 $validate = Validator::make($request->all(), [
48 48
                     'g-recaptcha-response' => 'required|captcha',
49 49
                 ]);
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             //
55 55
             // Check users exists and send an email
56 56
             //
57
-            $ret = ! empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
57
+            $ret = !empty($rssToken) ? User::getByRssToken($rssToken) : User::getByEmail($email);
58 58
             if ($ret === null) {
59 59
                 app('smarty.view')->assign('error', 'The email or apikey are not recognised.');
60 60
             } else {
Please login to merge, or discard this patch.
app/Extensions/helper/helpers.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 use Symfony\Component\Process\Process;
17 17
 use Zip as ZipStream;
18 18
 
19
-if (! function_exists('getRawHtml')) {
19
+if (!function_exists('getRawHtml')) {
20 20
     /**
21 21
      * @param  bool  $cookie
22 22
      * @return bool|mixed|string
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
     }
52 52
 }
53 53
 
54
-if (! function_exists('makeFieldLinks')) {
54
+if (!function_exists('makeFieldLinks')) {
55 55
     /**
56 56
      * @return string
57 57
      *
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     }
82 82
 }
83 83
 
84
-if (! function_exists('getUserBrowseOrder')) {
84
+if (!function_exists('getUserBrowseOrder')) {
85 85
     /**
86 86
      * @param  string  $orderBy
87 87
      */
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     }
108 108
 }
109 109
 
110
-if (! function_exists('getUserBrowseOrdering')) {
110
+if (!function_exists('getUserBrowseOrdering')) {
111 111
     function getUserBrowseOrdering(): array
112 112
     {
113 113
         return [
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
     }
138 138
 }
139 139
 
140
-if (! function_exists('getSimilarName')) {
140
+if (!function_exists('getSimilarName')) {
141 141
     /**
142 142
      * @param  string  $name
143 143
      */
@@ -147,14 +147,14 @@  discard block
 block discarded – undo
147 147
     }
148 148
 }
149 149
 
150
-if (! function_exists('color')) {
150
+if (!function_exists('color')) {
151 151
     function color(string $string = ''): Color
152 152
     {
153 153
         return new Color($string);
154 154
     }
155 155
 }
156 156
 
157
-if (! function_exists('human_filesize')) {
157
+if (!function_exists('human_filesize')) {
158 158
     /**
159 159
      * @param  int  $decimals
160 160
      */
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
     }
168 168
 }
169 169
 
170
-if (! function_exists('bcdechex')) {
170
+if (!function_exists('bcdechex')) {
171 171
     /**
172 172
      * @return string
173 173
      */
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
     }
185 185
 }
186 186
 
187
-if (! function_exists('runCmd')) {
187
+if (!function_exists('runCmd')) {
188 188
     /**
189 189
      * Run CLI command.
190 190
      *
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
     }
213 213
 }
214 214
 
215
-if (! function_exists('escapeString')) {
215
+if (!function_exists('escapeString')) {
216 216
     /**
217 217
      * @return string
218 218
      */
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     }
223 223
 }
224 224
 
225
-if (! function_exists('realDuration')) {
225
+if (!function_exists('realDuration')) {
226 226
     /**
227 227
      * @return string
228 228
      */
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
     }
235 235
 }
236 236
 
237
-if (! function_exists('is_it_json')) {
237
+if (!function_exists('is_it_json')) {
238 238
     /**
239 239
      * @param  array|string  $isIt
240 240
      * @return bool
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
     return $zipped;
278 278
 }
279 279
 
280
-if (! function_exists('release_flag')) {
280
+if (!function_exists('release_flag')) {
281 281
     // Function inspired by c0r3@newznabforums adds country flags on the browse page.
282 282
     /**
283 283
      * @param  string  $text  Text to match against.
@@ -413,10 +413,10 @@  discard block
 block discarded – undo
413 413
 
414 414
         return '';
415 415
     }
416
-    if (! function_exists('sanitize')) {
416
+    if (!function_exists('sanitize')) {
417 417
         function sanitize(array|string $phrases, array $doNotSanitize = []): string
418 418
         {
419
-            if (! is_array($phrases)) {
419
+            if (!is_array($phrases)) {
420 420
                 $wordArray = explode(' ', str_replace('.', ' ', $phrases));
421 421
             } else {
422 422
                 $wordArray = $phrases;
@@ -427,9 +427,9 @@  discard block
 block discarded – undo
427 427
             foreach ($wordArray as $words) {
428 428
                 $words = preg_split('/\s+/', $words);
429 429
                 foreach ($words as $st) {
430
-                    if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
430
+                    if (Str::startsWith($st, ['!', '+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
431 431
                         $str = $st;
432
-                    } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && ! preg_match('/([!+?\-*]){2,}/', $st)) {
432
+                    } elseif (Str::endsWith($st, ['+', '-', '?', '*']) && Str::length($st) > 1 && !preg_match('/([!+?\-*]){2,}/', $st)) {
433 433
                         $str = $st;
434 434
                     } else {
435 435
                         $str = Sanitizer::escape($st, $doNotSanitize);
Please login to merge, or discard this patch.