Passed
Push — master ( 82f66a...9d3bdd )
by Darko
05:59
created
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->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('indexer.categorise.catwebdl') === 0) {
426
+            if (str_contains($categoryIDs, (string) Category::TV_HD) && !str_contains($categoryIDs, (string) Category::TV_WEBDL) && (int) Settings::settingValue('indexer.categorise.catwebdl') === 0) {
427 427
                 $categoryIDs .= (','.Category::TV_WEBDL);
428 428
             }
429 429
             $categoryID = explode(',', $categoryIDs);
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/Models/Release.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
     public static function updateRelease($id, $name, $searchName, $fromName, $categoryId, $parts, $grabs, $size, $postedDate, $addedDate, $videoId, $episodeId, $imDbId, $aniDbId): void
276 276
     {
277 277
         $movieInfoId = null;
278
-        if (! empty($imDbId)) {
278
+        if (!empty($imDbId)) {
279 279
             $movieInfoId = MovieInfo::whereImdbid($imDbId)->first(['id']);
280 280
         }
281 281
         self::whereId($id)->update(
@@ -526,12 +526,12 @@  discard block
 block discarded – undo
526 526
 
527 527
         preg_match('/(^\w+[-_. ].+?\.(\d+p)).+/i', $rel['searchname'], $similar);
528 528
 
529
-        if (! empty($similar)) {
529
+        if (!empty($similar)) {
530 530
             if (config('nntmux.elasticsearch_enabled') === true) {
531 531
                 $searchResult = (new ElasticSearchSiteSearch)->indexSearch($similar[1], 10);
532 532
             } else {
533 533
                 $searchResult = (new ManticoreSearch)->searchIndexes('releases_rt', $similar[1]);
534
-                if (! empty($searchResult)) {
534
+                if (!empty($searchResult)) {
535 535
                     $searchResult = Arr::wrap(Arr::get($searchResult, 'id'));
536 536
                 }
537 537
             }
Please login to merge, or discard this patch.
app/Console/Commands/NntmuxPopulateSearchIndexes.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         $manticore->truncateRTIndex(Arr::wrap('releases_rt'));
65 65
         $data = [];
66 66
         $total = Release::count();
67
-        if (! $total) {
67
+        if (!$total) {
68 68
             $this->warn('Releases table is empty. Nothing to do.');
69 69
             exit();
70 70
         }
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id'])
85 85
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
86 86
             ->groupBy('id')
87
-            ->chunk($max, function ($releases) use ($manticore, $bar, $data) {
87
+            ->chunk($max, function($releases) use ($manticore, $bar, $data) {
88 88
                 foreach ($releases as $r) {
89 89
                     $data[] = [
90 90
                         'id' => $r->id,
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $data = [];
113 113
 
114 114
         $total = Predb::count();
115
-        if (! $total) {
115
+        if (!$total) {
116 116
             $this->warn('PreDB table is empty. Nothing to do.');
117 117
             exit();
118 118
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
             ->select(['id', 'title', 'filename', 'source'])
130 130
             ->groupBy('id')
131 131
             ->orderBy('id')
132
-            ->chunk($max, function ($pre) use ($manticore, $bar, $data) {
132
+            ->chunk($max, function($pre) use ($manticore, $bar, $data) {
133 133
                 foreach ($pre as $p) {
134 134
                     $data[] = [
135 135
                         'id' => $p->id,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
         $data = ['body' => []];
152 152
         $elastic = new ElasticSearchSiteSearch;
153 153
         $total = Release::count();
154
-        if (! $total) {
154
+        if (!$total) {
155 155
             $this->warn('Could not get database information for releases table.');
156 156
             exit();
157 157
         }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             ->select(['releases.id', 'releases.name', 'releases.searchname', 'releases.fromname', 'releases.categories_id', 'releases.postdate'])
170 170
             ->selectRaw('IFNULL(GROUP_CONCAT(release_files.name SEPARATOR " "),"") filename')
171 171
             ->groupBy('id')
172
-            ->chunk($max, function ($releases) use ($bar, $data) {
172
+            ->chunk($max, function($releases) use ($bar, $data) {
173 173
                 foreach ($releases as $r) {
174 174
                     $searchName = str_replace(['.', '-'], ' ', $r->searchname);
175 175
                     $data['body'][] = [
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $data = ['body' => []];
203 203
         $elastic = new ElasticSearchSiteSearch;
204 204
         $total = Predb::count();
205
-        if (! $total) {
205
+        if (!$total) {
206 206
             $this->warn('Could not get database information for predb table.');
207 207
             exit();
208 208
         }
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
             ->select(['id', 'title', 'filename', 'source'])
220 220
             ->groupBy('id')
221 221
             ->orderBy('id')
222
-            ->chunk($max, function ($pre) use ($bar, $data) {
222
+            ->chunk($max, function($pre) use ($bar, $data) {
223 223
                 foreach ($pre as $p) {
224 224
                     $data['body'][] = [
225 225
                         'index' => [
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.