GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — dev (#2644)
by
unknown
13:38
created
www/admin/poster-delete.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -6,13 +6,13 @@
 block discarded – undo
6 6
 
7 7
 $page = new AdminPage();
8 8
 
9
-if (isset($_GET['id']))
10
-{
9
+if (isset($_GET['id'])) {
11 10
 	MultigroupPosters::remove(['id' => $_GET['id']]);
12 11
 }
13 12
 
14
-if (isset($_GET['from']))
13
+if (isset($_GET['from'])) {
15 14
 	$referrer = $_GET['from'];
16
-else
15
+} else {
17 16
 	$referrer = $_SERVER['HTTP_REFERER'];
17
+}
18 18
 header("Location: " . $referrer);
Please login to merge, or discard this patch.
www/admin/posters-list.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
 use app\models\MultigroupPosters;
5 5
 use nzedb\db\DB;
6 6
 
7
-$page   = new AdminPage();
7
+$page = new AdminPage();
8 8
 $pdo = new DB();
9 9
 $posters = MultigroupPosters::find('all', ['order' => ['poster' => 'ASC']]);
10 10
 
Please login to merge, or discard this patch.
nzedb/Groups.php 1 patch
Upper-Lower-Casing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -423,7 +423,7 @@  discard block
 block discarded – undo
423 423
 			WHERE mp.groups_id = {$id}"
424 424
 		);
425 425
 
426
-		foreach ($this->cbpm AS $tablePrefix) {
426
+		foreach ($this->cbpm as $tablePrefix) {
427 427
 			$this->pdo->queryExec(
428 428
 				"DROP TABLE IF EXISTS {$tablePrefix}_{$id}"
429 429
 			);
@@ -445,15 +445,15 @@  discard block
 block discarded – undo
445 445
 	 */
446 446
 	public function resetall()
447 447
 	{
448
-		foreach ($this->cbpm AS $tablePrefix) {
448
+		foreach ($this->cbpm as $tablePrefix) {
449 449
 			$this->pdo->queryExec("TRUNCATE TABLE {$tablePrefix}");
450 450
 		}
451 451
 
452 452
 		$groups = $this->pdo->queryDirect("SELECT id FROM groups");
453 453
 
454 454
 		if ($groups instanceof \Traversable) {
455
-			foreach ($groups AS $group) {
456
-				foreach ($this->cbpm AS $tablePrefix) {
455
+			foreach ($groups as $group) {
456
+				foreach ($this->cbpm as $tablePrefix) {
457 457
 					$this->pdo->queryExec("DROP TABLE IF EXISTS {$tablePrefix}_{$group['id']}");
458 458
 				}
459 459
 			}
@@ -492,7 +492,7 @@  discard block
 block discarded – undo
492 492
 			$releases = new Releases(['Settings' => $this->pdo, 'Groups' => $this]);
493 493
 			$nzb = new NZB($this->pdo);
494 494
 			$releaseImage = new ReleaseImage($this->pdo);
495
-			foreach ($res AS $row) {
495
+			foreach ($res as $row) {
496 496
 				$releases->deleteSingle(
497 497
 					[
498 498
 						'g' => $row['guid'],
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
 			WHERE id = {$id}"
577 577
 		);
578 578
 
579
-		return "Group {$id}: {$column} has been " . (($status == 0) ? 'deactivated' : 'activated') . '.';
579
+		return "group {$id}: {$column} has been " . (($status == 0) ? 'deactivated' : 'activated') . '.';
580 580
 	}
581 581
 
582 582
 	/**
Please login to merge, or discard this patch.
misc/testing/DB/reset_truncate.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 	foreach ($arr as &$value) {
16 16
 		$rel = $pdo->queryExec("TRUNCATE TABLE $value");
17 17
 		if ($rel !== false) {
18
-			echo $pdo->log->primary("Truncating ${value} completed.");
18
+			echo $pdo->log->primary("truncating ${value} completed.");
19 19
 		}
20 20
 	}
21 21
 	unset($value);
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 			if ($argv[1] == "drop") {
29 29
 				$rel = $pdo->queryDirect(sprintf('DROP TABLE %s', $tbl));
30 30
 				if ($rel !== false) {
31
-					echo $pdo->log->primary("Dropping ${tbl} completed.");
31
+					echo $pdo->log->primary("dropping ${tbl} completed.");
32 32
 				}
33 33
 			} else {
34 34
 				$rel = $pdo->queryDirect(sprintf('TRUNCATE TABLE %s', $tbl));
35 35
 				if ($rel !== false) {
36
-					echo $pdo->log->primary("Truncating ${tbl} completed.");
36
+					echo $pdo->log->primary("truncating ${tbl} completed.");
37 37
 				}
38 38
 			}
39 39
 		}
Please login to merge, or discard this patch.
nzedb/db/DB.php 2 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -198,7 +198,7 @@
 block discarded – undo
198 198
 				$this->initialiseDatabase($options['dbname']);
199 199
 			}
200 200
 
201
-			$this->pdo->query("USE {$options['dbname']}");
201
+			$this->pdo->query("use {$options['dbname']}");
202 202
 		}
203 203
 
204 204
 		$this->consoleTools =& $options['ct'];
Please login to merge, or discard this patch.
Spacing   +13 added lines, -15 removed lines patch added patch discarded remove patch
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 			$this->pdo->query("USE {$options['dbname']}");
225 225
 		}
226 226
 
227
-		$this->consoleTools =& $options['ct'];
228
-		$this->log =& $options['log'];
227
+		$this->consoleTools = & $options['ct'];
228
+		$this->log = & $options['log'];
229 229
 
230 230
 		$this->cacheEnabled = (defined('nZEDb_CACHE_TYPE') && (nZEDb_CACHE_TYPE > 0) ? true : false);
231 231
 
@@ -512,8 +512,7 @@  discard block
 block discarded – undo
512 512
 	 */
513 513
 	public function getDatabasesList()
514 514
 	{
515
-		$query = ($this->dbSystem === 'mysql' ? 'SHOW DATABASES' :
516
-			'SELECT datname AS database FROM pg_database');
515
+		$query = ($this->dbSystem === 'mysql' ? 'SHOW DATABASES' : 'SELECT datname AS database FROM pg_database');
517 516
 		$result = $this->pdo->query($query);
518 517
 
519 518
 		return $result->fetchAll(\PDO::FETCH_ASSOC);
@@ -1365,7 +1364,7 @@  discard block
 block discarded – undo
1365 1364
 		// Find Database sever's TZ.
1366 1365
 		$tz = $this->queryOneRow('SELECT @@global.time_zone as global, @@session.time_zone as session');
1367 1366
 
1368
-		if($this->sphinx === false) {
1367
+		if ($this->sphinx === false) {
1369 1368
 			if (empty($tz)) {
1370 1369
 				throw new \ErrorException("Unable to fetch database's tz_session settings.");
1371 1370
 			}
@@ -1382,19 +1381,19 @@  discard block
 block discarded – undo
1382 1381
 				}
1383 1382
 			}
1384 1383
 
1385
-			$this->tz_session	= $options['timezone'];
1386
-			$this->tz_original	= $tz['session'];
1387
-			$this->tz_server	= $tz['global'];
1384
+			$this->tz_session = $options['timezone'];
1385
+			$this->tz_original = $tz['session'];
1386
+			$this->tz_server = $tz['global'];
1388 1387
 		} else {
1389 1388
 			$this->tz_session = $this->tz_original = $this->tz_server = $options['timezone'];
1390 1389
 		}
1391 1390
 
1392 1391
 		$this->host			= $options['dbhost'];
1393 1392
 		$this->name			= $options['dbname'];
1394
-		$this->password		= $options['dbpass'];
1395
-		$this->persist		= $options['persist'];
1393
+		$this->password = $options['dbpass'];
1394
+		$this->persist = $options['persist'];
1396 1395
 		$this->port			= $options['dbport'];
1397
-		$this->socket		= $options['dbsock'];
1396
+		$this->socket = $options['dbsock'];
1398 1397
 		$this->user			= $options['dbuser'];
1399 1398
 
1400 1399
 		return true;
@@ -1414,8 +1413,7 @@  discard block
 block discarded – undo
1414 1413
 			$this->debugging->log(get_class(), $method, $error, $severity);
1415 1414
 
1416 1415
 			echo(
1417
-			($this->cli ? $this->log->error($error) . PHP_EOL :
1418
-				'<div class="error">' . $error . '</div>')
1416
+			($this->cli ? $this->log->error($error) . PHP_EOL : '<div class="error">' . $error . '</div>')
1419 1417
 			);
1420 1418
 		}
1421 1419
 
@@ -1515,7 +1513,7 @@  discard block
 block discarded – undo
1515 1513
 			'unrarpath'          => '',
1516 1514
 			'yydecoderpath'      => '',
1517 1515
 		];
1518
-		$fields += $defaults;    // Make sure keys exist to avoid error notices.
1516
+		$fields += $defaults; // Make sure keys exist to avoid error notices.
1519 1517
 		ksort($fields);
1520 1518
 		// Validate settings
1521 1519
 		$fields['nzbpath'] = Text::trailingSlash($fields['nzbpath']);
@@ -1613,7 +1611,7 @@  discard block
 block discarded – undo
1613 1611
 
1614 1612
 		if ($found) {
1615 1613
 			//var_dump(self::getTableList());
1616
-			throw new \RuntimeException("Could not drop your old database: '{$name}'" ,
1614
+			throw new \RuntimeException("Could not drop your old database: '{$name}'",
1617 1615
 				2);
1618 1616
 		} else {
1619 1617
 			$this->pdo->query("CREATE DATABASE `{$name}` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci");
Please login to merge, or discard this patch.
www/install/index.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@
 block discarded – undo
89 89
 			} else {
90 90
 				?>
91 91
 				<div class="error">Installation Locked! If reinstalling, please remove <?php echo
92
-                        nZEDb_CONFIGS . 'install.lock' ?>.</div>
92
+						nZEDb_CONFIGS . 'install.lock' ?>.</div>
93 93
 			<?php
94 94
 			}
95 95
 		}
Please login to merge, or discard this patch.
app/models/Settings.php 1 patch
Spacing   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 	public static function init()
161 161
 	{
162 162
 		static::finder('setting',
163
-			function ($params, $next) {
163
+			function($params, $next) {
164 164
 
165 165
 				$params['options']['conditions'] = self::settingToArray($params['options']['conditions']);
166 166
 				$params['type'] = 'first';
@@ -192,8 +192,7 @@  discard block
 block discarded – undo
192 192
 	public static function toTree(array $options = [], $excludeUnsectioned = true)
193 193
 	{
194 194
 		$results = empty($options) ?
195
-			Settings::find('all') :
196
-			Settings::find('all', $options);
195
+			Settings::find('all') : Settings::find('all', $options);
197 196
 		$results = $results->data();
198 197
 
199 198
 		$tree = [];
Please login to merge, or discard this patch.
misc/update/nix/tmux/run.php 1 patch
Upper-Lower-Casing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 }
52 52
 
53 53
 if ($seq == 1) {
54
-	exec("cd ${DIR}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
54
+	exec("cd ${dir}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
55 55
 	exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -h -p 67 'printf \"\033]2;update_releases\033\"'");
56 56
 	exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -v -p 25 'printf \"\033]2;nzb-import\033\"'");
57 57
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 	attach($DIR, $tmux_session);
66 66
 } else {
67 67
 	if ($seq == 2) {
68
-		exec("cd ${DIR}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
68
+		exec("cd ${dir}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;\"Monitor\"\033\"'");
69 69
 		exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -h -p 67 'printf \"\033]2;sequential\033\"'");
70 70
 		exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -v -p 25 'printf \"\033]2;nzb-import\033\"'");
71 71
 
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 		start_apps($tmux_session);
78 78
 		attach($DIR, $tmux_session);
79 79
 	} else {
80
-		exec("cd ${DIR}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;Monitor\033\"'");
80
+		exec("cd ${dir}/update/nix/tmux; tmux -f $tmuxconfig new-session -d -s $tmux_session -n Monitor 'printf \"\033]2;Monitor\033\"'");
81 81
 		exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -h -p 67 'printf \"\033]2;update_binaries\033\"'");
82 82
 		exec("tmux select-pane -t $tmux_session:0.0; tmux split-window -t $tmux_session:0 -v -p 25 'printf \"\033]2;nzb-import\033\"'");
83 83
 		exec("tmux select-pane -t $tmux_session:0.2; tmux split-window -t $tmux_session:0 -v -p 67 'printf \"\033]2;backfill\033\"'");
Please login to merge, or discard this patch.
nzedb/Categorize.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1063,10 +1063,10 @@
 block discarded – undo
1063 1063
 			$this->tmpCat = Category::XXX_SD;
1064 1064
 			return true;
1065 1065
 		}
1066
-		if($this->checkPoster( '/oz@lot[.]com/i', $this->poster, Category::XXX_SD)) {
1066
+		if ($this->checkPoster('/oz@lot[.]com/i', $this->poster, Category::XXX_SD)) {
1067 1067
 			return true;
1068 1068
 		}
1069
-		if($this->checkPoster( '/anon@y[.]com/i', $this->poster, Category::XXX_SD)) {
1069
+		if ($this->checkPoster('/anon@y[.]com/i', $this->poster, Category::XXX_SD)) {
1070 1070
 			return true;
1071 1071
 		}
1072 1072
 		return false;
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
 			case $this->isMovie():
97 97
 			case $this->isConsole():
98 98
 			case $this->isBook():
99
-            case $this->isMusic():
99
+			case $this->isMusic():
100 100
 				return $this->tmpCat;
101 101
 		}
102 102
 
@@ -177,7 +177,7 @@  discard block
 block discarded – undo
177 177
 						case $this->isHDTV():
178 178
 						case $this->isSDTV():
179 179
 						case $this->isPC():
180
-                        case $this->isSportTV():
180
+						case $this->isSportTV():
181 181
 							break;
182 182
 						default:
183 183
 							return false;
@@ -636,20 +636,20 @@  discard block
 block discarded – undo
636 636
 
637 637
 	public function isSportTV()
638 638
 	{
639
-        switch (true) {
640
-            case preg_match('/s\d{1,3}[-._ ]?[ed]\d{1,3}([ex]\d{1,3}|[-.\w ])/i', $this->releaseName):
641
-                return false;
642
-            case preg_match('/[-._ ]?(Bellator|bundesliga|EPL|ESPN|FIA|la[-._ ]liga|MMA|motogp|NFL|MLB|NCAA|PGA|FIM|NJPW|red[-._ ]bull|.+race|Sengoku|Strikeforce|supercup|uefa|UFC|wtcc|WWE)[-._ ]/i', $this->releaseName):
643
-            case preg_match('/[-._ ]?(DTM|FIFA|formula[-._ ]1|indycar|Rugby|NASCAR|NBA|NHL|NRL|netball[-._ ]anz|ROH|SBK|Superleague|The[-._ ]Ultimate[-._ ]Fighter|TNA|V8[-._ ]Supercars|WBA|WrestleMania)[-._ ]/i', $this->releaseName):
644
-            case preg_match('/[-._ ]?(AFL|Grand Prix|Indy[-._ ]Car|(iMPACT|Smoky[-._ ]Mountain|Texas)[-._ ]Wrestling|Moto[-._ ]?GP|NSCS[-._ ]ROUND|NECW|Poker|PWX|Rugby|WCW)[-._ ]/i', $this->releaseName):
645
-            case preg_match('/[-._ ]?(Horse)[-._ ]Racing[-._ ]/i', $this->releaseName):
646
-            case preg_match('/[-._ ](VERUM|GRiP|Ebi|OVERTAKE)/i', $this->releaseName):
647
-                $this->tmpCat = Category::TV_SPORT;
648
-
649
-                return true;
650
-            default:
651
-                return false;
652
-        }
639
+		switch (true) {
640
+			case preg_match('/s\d{1,3}[-._ ]?[ed]\d{1,3}([ex]\d{1,3}|[-.\w ])/i', $this->releaseName):
641
+				return false;
642
+			case preg_match('/[-._ ]?(Bellator|bundesliga|EPL|ESPN|FIA|la[-._ ]liga|MMA|motogp|NFL|MLB|NCAA|PGA|FIM|NJPW|red[-._ ]bull|.+race|Sengoku|Strikeforce|supercup|uefa|UFC|wtcc|WWE)[-._ ]/i', $this->releaseName):
643
+			case preg_match('/[-._ ]?(DTM|FIFA|formula[-._ ]1|indycar|Rugby|NASCAR|NBA|NHL|NRL|netball[-._ ]anz|ROH|SBK|Superleague|The[-._ ]Ultimate[-._ ]Fighter|TNA|V8[-._ ]Supercars|WBA|WrestleMania)[-._ ]/i', $this->releaseName):
644
+			case preg_match('/[-._ ]?(AFL|Grand Prix|Indy[-._ ]Car|(iMPACT|Smoky[-._ ]Mountain|Texas)[-._ ]Wrestling|Moto[-._ ]?GP|NSCS[-._ ]ROUND|NECW|Poker|PWX|Rugby|WCW)[-._ ]/i', $this->releaseName):
645
+			case preg_match('/[-._ ]?(Horse)[-._ ]Racing[-._ ]/i', $this->releaseName):
646
+			case preg_match('/[-._ ](VERUM|GRiP|Ebi|OVERTAKE)/i', $this->releaseName):
647
+				$this->tmpCat = Category::TV_SPORT;
648
+
649
+				return true;
650
+			default:
651
+				return false;
652
+		}
653 653
 	}
654 654
 
655 655
 	public function isDocumentaryTV()
Please login to merge, or discard this patch.