Passed
Push — master ( 4c841c...172093 )
by Darko
03:36
created
app/Http/Controllers/SearchController.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             foreach ($releases->getBrowseOrdering() as $orderType) {
66 66
                 $this->smarty->assign(
67 67
                     'orderby'.$orderType,
68
-                    url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES | ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType));
68
+                    url('/search?search='.htmlentities($searchString['searchname'], ENT_QUOTES|ENT_HTML5).'&t='.implode(',', $categoryID).'&ob='.$orderType));
69 69
             }
70 70
 
71 71
             $rslt = $releases->search(
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         if ($searchType !== 'basic' && $request->missing('id') && $request->missing('subject') && $request->anyFilled(['searchadvr', 'searchadvsubject', 'searchadvfilename', 'searchadvposter'])) {
124 124
             $orderByString = '';
125 125
             foreach ($searchVars as $searchVarKey => $searchVar) {
126
-                $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES | ENT_HTML5);
126
+                $orderByString .= "&$searchVarKey=".htmlentities($searchVar, ENT_QUOTES|ENT_HTML5);
127 127
             }
128 128
             $orderByString = ltrim($orderByString, '&');
129 129
 
Please login to merge, or discard this patch.
Blacklight/processing/tv/TVDB.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
                 }
130 130
 
131 131
                 if ((int) $videoId > 0 && (int) $tvDbId > 0) {
132
-                    if (! empty($tvdbShow['poster'])) { // Use TVDB poster if available
132
+                    if (!empty($tvdbShow['poster'])) { // Use TVDB poster if available
133 133
                         $this->getPoster($videoId);
134 134
                     } else { // Check Fanart.tv for poster
135 135
                         $poster = $this->fanart->getTVFanArt($tvDbId);
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
                         }
140 140
                     }
141 141
 
142
-                    $seasonNo = (! empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : '');
143
-                    $episodeNo = (! empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : '');
142
+                    $seasonNo = (!empty($release['season']) ? preg_replace('/^S0*/i', '', $release['season']) : '');
143
+                    $episodeNo = (!empty($release['episode']) ? preg_replace('/^E0*/i', '', $release['episode']) : '');
144 144
 
145 145
                     if ($episodeNo === 'all') {
146 146
                         // Set the video ID and leave episode 0
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                     }
152 152
 
153 153
                     // Download all episodes if new show to reduce API/bandwidth usage
154
-                    if (! $this->countEpsByVideoID($videoId)) {
154
+                    if (!$this->countEpsByVideoID($videoId)) {
155 155
                         $this->getEpisodeInfo($tvDbId, -1, -1, $videoId);
156 156
                     }
157 157
 
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
                     }
252 252
 
253 253
                     // Check for show aliases and try match those too
254
-                    if (! empty($show->aliases)) {
254
+                    if (!empty($show->aliases)) {
255 255
                         foreach ($show->aliases as $key => $name) {
256 256
                             $matchPercent = $this->checkMatch(strtolower($name), strtolower($name), $matchPercent);
257 257
                             if ($matchPercent > $highestMatch) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
                     }
263 263
                 }
264 264
             }
265
-            if (! empty($highest)) {
265
+            if (!empty($highest)) {
266 266
                 $return = $this->formatShowInfo($highest);
267 267
             }
268 268
         }
@@ -298,7 +298,7 @@  discard block
 block discarded – undo
298 298
     {
299 299
         $return = $response = false;
300 300
 
301
-        if (! $this->local) {
301
+        if (!$this->local) {
302 302
             if ($videoId > 0) {
303 303
                 try {
304 304
                     $response = $this->client->series()->allEpisodes($tvDbId);
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
             $poster = $this->client->series()->artworks($show->tvdb_id);
357 357
             // Grab the image with the highest score where type == 2
358 358
             $poster = collect($poster)->where('type', 2)->sortByDesc('score')->first();
359
-            $this->posterUrl = ! empty($poster->image) ? $poster->image : '';
359
+            $this->posterUrl = !empty($poster->image) ? $poster->image : '';
360 360
         } catch (ResourceNotFoundException $e) {
361 361
             $this->colorCli->climate()->error('Poster image not found on TVDB');
362 362
         } catch (UnauthorizedException $error) {
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
             'tvrage' => 0,
397 397
             'tvmaze' => 0,
398 398
             'tmdb' => 0,
399
-            'aliases' => ! empty($show->aliases) ? $show->aliases : '',
399
+            'aliases' => !empty($show->aliases) ? $show->aliases : '',
400 400
             'localzone' => "''",
401 401
         ];
402 402
     }
Please login to merge, or discard this patch.
app/Models/Settings.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 
121 121
         // If there's an override and no mutator has been explicitly defined on
122 122
         // the model then use the override value
123
-        if ($override && ! $this->hasGetMutator($key)) {
123
+        if ($override && !$this->hasGetMutator($key)) {
124 124
             return $override->value;
125 125
         }
126 126
 
@@ -141,9 +141,9 @@  discard block
 block discarded – undo
141 141
         $results = self::cursor()->remember();
142 142
 
143 143
         $tree = [];
144
-        if (! empty($results)) {
144
+        if (!empty($results)) {
145 145
             foreach ($results as $result) {
146
-                if (! $excludeUnsectioned || ! empty($result->section)) {
146
+                if (!$excludeUnsectioned || !empty($result->section)) {
147 147
                     $tree[$result->section][$result->subsection][$result->name] =
148 148
                         ['value' => $result->value, 'hint' => $result->hint];
149 149
                 }
Please login to merge, or discard this patch.
misc/testing/Dev/clean_nzbs.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@  discard block
 block discarded – undo
14 14
 $dir = resource_path().'/movednzbs/';
15 15
 $colorCli = new ColorCLI;
16 16
 
17
-if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) {
17
+if (!isset($argv[1]) || !in_array($argv[1], ['true', 'move'])) {
18 18
     $colorCli->error("This script can remove all nzbs not found in the db and all releases with no nzbs found. It can also move invalid nzbs.\n\n"
19 19
         ."php $argv[0] true     ...: For a dry run, to see how many would be moved.\n"
20 20
         ."php $argv[0] move     ...: Move NZBs that are possibly bad or have no release. They are moved into this folder: $dir");
21 21
     exit();
22 22
 }
23 23
 
24
-if (! File::isDirectory($dir) && ! File::makeDirectory($dir)) {
24
+if (!File::isDirectory($dir) && !File::makeDirectory($dir)) {
25 25
     exit("ERROR: Could not create folder [$dir].".PHP_EOL);
26 26
 }
27 27
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     if (File::isFile($filePath) && $guid) {
45 45
         $nzbfile = Utility::unzipGzipFile($filePath);
46 46
         $nzbContents = $nzb->nzbFileList($nzbfile, ['no-file-key' => false, 'strip-count' => true]);
47
-        if (! $nzbfile || ! @simplexml_load_string($nzbfile) || count($nzbContents) === 0) {
47
+        if (!$nzbfile || !@simplexml_load_string($nzbfile) || count($nzbContents) === 0) {
48 48
             if ($argv[1] === 'move') {
49 49
                 rename($filePath, $dir.$guid.'.nzb.gz');
50 50
             }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 $res = Release::query()->select(['id', 'guid', 'nzbstatus'])->get();
66 66
 foreach ($res as $row) {
67 67
     $nzbpath = $nzb->getNZBPath($row->guid);
68
-    if (! File::isFile($nzbpath)) {
68
+    if (!File::isFile($nzbpath)) {
69 69
         $deleted++;
70 70
         $releases->deleteSingle(['g' => $row->guid, 'i' => $row->id], $nzb, $releaseImage);
71 71
     } elseif ($row->nzbstatus !== 1) {
Please login to merge, or discard this patch.
misc/testing/Releases/recategorize.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 
11 11
 $colorCli = new ColorCLI;
12 12
 
13
-if (! (isset($argv[1]) && ($argv[1] === 'all' || $argv[1] === 'misc' || preg_match('/\([\d, ]+\)/', $argv[1]) || is_numeric($argv[1])))) {
13
+if (!(isset($argv[1]) && ($argv[1] === 'all' || $argv[1] === 'misc' || preg_match('/\([\d, ]+\)/', $argv[1]) || is_numeric($argv[1])))) {
14 14
     $colorCli->error(
15 15
         "\nThis script will attempt to re-categorize releases and is useful if changes have been made to Category.php.\n"
16 16
         ."No updates will be done unless the category changes\n"
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     $timeStart = now();
41 41
     $chgCount = categorizeRelease($argv, true);
42 42
     $time = now()->diffInSeconds($timeStart, true);
43
-    if (! isset($argv[2])) {
43
+    if (!isset($argv[2])) {
44 44
         $colorCli->header('Finished re-categorizing '.number_format($chgCount).' releases in '.$time.' seconds, using the searchname.').PHP_EOL;
45 45
     } else {
46 46
         $colorCli->header('Finished re-categorizing in '.$time.' seconds , using the searchname.'.PHP_EOL
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
     $consoleTools = new ConsoleTools;
69 69
     $relCount = $chgCount = 0;
70 70
     if ($total > 0) {
71
-        $query->chunk('100', function ($results) use ($update, $relCount, $chgCount) {
71
+        $query->chunk('100', function($results) use ($update, $relCount, $chgCount) {
72 72
             $cat = new Categorize;
73 73
             foreach ($results as $result) {
74 74
                 $catId = $cat->determineCategory($result->groups_id, $result->searchname, $result->fromname);
Please login to merge, or discard this patch.
misc/testing/Tests/test_trakt_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $c = new Blacklight\ColorCLI;
8 8
 $trakt = new TraktTv;
9 9
 
10
-if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
10
+if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
11 11
     // Test if your Trakt API key and configuration are working
12 12
     // If it works you should get a printed array of the show/season/episode entered
13 13
 
Please login to merge, or discard this patch.
misc/testing/Tests/test_omdb_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $omdb = new OMDbAPI(config('nntmux_api.omdb_api_key'));
9 9
 $colorCli = new ColorCLI;
10 10
 
11
-if (! empty($argv[1]) && ! empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) {
11
+if (!empty($argv[1]) && !empty($argv[2]) && ($argv[2] !== 'series' || $argv[2] !== 'movie')) {
12 12
     // Test if your OMDb API key and configuration are working
13 13
     // If it works you should get a printed array of the show entered
14 14
 
Please login to merge, or discard this patch.
misc/testing/Tests/test_fanarttv_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 $fanart = new FanartTV(config('nntmux_api.fanarttv_api_key'));
9 9
 $colorCli = new ColorCLI;
10 10
 
11
-if (! empty($argv[1])) {
11
+if (!empty($argv[1])) {
12 12
     // Test if you can fetch Fanart.TV images
13 13
 
14 14
     // Search for a movie/tv
Please login to merge, or discard this patch.
misc/testing/Tests/test_tvmaze_API.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 $c = new Blacklight\ColorCLI;
8 8
 $tvmaze = new TVMaze;
9 9
 
10
-if (! empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
10
+if (!empty($argv[1]) && is_numeric($argv[2]) && is_numeric($argv[3])) {
11 11
     // Test if your TVMaze API configuration is working
12 12
     // If it works you should get a var dumped array of the show/season/episode entered
13 13
 
Please login to merge, or discard this patch.