Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Branch master (0a752f)
by Dan
03:57
created
admin/Default/log_console.php 1 patch
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,15 +19,17 @@
 block discarded – undo
19 19
 								'Notes' => '');
20 20
 
21 21
 		$db2->query('SELECT notes FROM log_has_notes WHERE account_id = ' . $db2->escapeNumber($accountID));
22
-		if ($db2->nextRecord())
23
-			$loggedAccounts[$accountID]['Notes'] = nl2br($db2->getField('notes'));
22
+		if ($db2->nextRecord()) {
23
+					$loggedAccounts[$accountID]['Notes'] = nl2br($db2->getField('notes'));
24
+		}
24 25
 	}
25 26
 
26 27
 	// put hidden fields in for log type to have all fields selected on next page.
27 28
 	$logTypes = array();
28 29
 	$db->query('SELECT log_type_id FROM log_type');
29
-	while ($db->nextRecord())
30
-		$logTypes[] = $db->getInt('log_type_id');
30
+	while ($db->nextRecord()) {
31
+			$logTypes[] = $db->getInt('log_type_id');
32
+	}
31 33
 	$template->assign('LogTypes', $logTypes);
32 34
 
33 35
 	$template->assign('LogConsoleFormHREF', SmrSession::getNewHREF(create_container('skeleton.php', 'log_console_detail.php')));
Please login to merge, or discard this patch.
admin/Default/box_delete_processing.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,15 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 $action = $_REQUEST['action'];
3 3
 if ($action == 'Marked Messages') {
4
-	if (!isset($_REQUEST['message_id']))
5
-		create_error('You must choose the messages you want to delete.');
4
+	if (!isset($_REQUEST['message_id'])) {
5
+			create_error('You must choose the messages you want to delete.');
6
+	}
6 7
 
7
-	foreach ($_REQUEST['message_id'] as $id)
8
-		$db->query('DELETE FROM message_boxes WHERE message_id = ' . $db->escapeNumber($id));
9
-}
10
-else if ($action == 'All Messages') {
11
-	if (!isset($var['box_type_id']))
12
-		create_error('No box selected.');
8
+	foreach ($_REQUEST['message_id'] as $id) {
9
+			$db->query('DELETE FROM message_boxes WHERE message_id = ' . $db->escapeNumber($id));
10
+	}
11
+	} else if ($action == 'All Messages') {
12
+	if (!isset($var['box_type_id'])) {
13
+			create_error('No box selected.');
14
+	}
13 15
 	$db->query('DELETE FROM message_boxes WHERE box_type_id = ' . $db->escapeNumber($var['box_type_id']));
14 16
 }
15 17
 forward(create_container('skeleton.php', 'box_view.php'));
Please login to merge, or discard this patch.
admin/Default/album_approve.php 1 patch
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,9 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 function get_album_nick($album_id) {
4
-	if ($album_id == 0)
5
-		return 'System';
4
+	if ($album_id == 0) {
5
+			return 'System';
6
+	}
6 7
 
7 8
 	return SmrAccount::getAccount($album_id)->getHofName();
8 9
 }
@@ -59,12 +60,15 @@  discard block
 block discarded – undo
59 60
 	$nick = get_album_nick($album_id);
60 61
 	$template->assign('Nick', $nick);
61 62
 
62
-	if (!empty($day) && !empty($month) && !empty($year))
63
-		$birthdate = $month . ' / ' . $day . ' / ' . $year;
64
-	if (empty($birthdate) && !empty($year))
65
-		$birthdate = 'Year ' . $year;
66
-	if (empty($birthdate))
67
-		$birthdate = 'N/A';
63
+	if (!empty($day) && !empty($month) && !empty($year)) {
64
+			$birthdate = $month . ' / ' . $day . ' / ' . $year;
65
+	}
66
+	if (empty($birthdate) && !empty($year)) {
67
+			$birthdate = 'Year ' . $year;
68
+	}
69
+	if (empty($birthdate)) {
70
+			$birthdate = 'N/A';
71
+	}
68 72
 	$template->assign('Birthdate', $birthdate);
69 73
 
70 74
 	// get the time that passed since the entry was last changed
Please login to merge, or discard this patch.
admin/Default/album_moderate_processing.php 1 patch
Braces   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -10,10 +10,11 @@  discard block
 block discarded – undo
10 10
 
11 11
 	$db->lockTable('album_has_comments');
12 12
 	$db->query('SELECT MAX(comment_id) FROM album_has_comments WHERE album_id = ' . $db->escapeNumber($account_id));
13
-	if ($db->nextRecord())
14
-		$comment_id = $db->getField('MAX(comment_id)') + 1;
15
-	else
16
-		$comment_id = 1;
13
+	if ($db->nextRecord()) {
14
+			$comment_id = $db->getField('MAX(comment_id)') + 1;
15
+	} else {
16
+			$comment_id = 1;
17
+	}
17 18
 
18 19
 	$db->query('INSERT INTO album_has_comments
19 20
 				(album_id, comment_id, time, post_id, msg)
@@ -31,17 +32,17 @@  discard block
 block discarded – undo
31 32
 		$mail->send();
32 33
 	}
33 34
 
34
-} else if ($var['task'] == 'reset_location')
35
+} else if ($var['task'] == 'reset_location') {
35 36
 	$db->query('UPDATE album SET location = \'\' WHERE account_id = ' . $db->escapeNumber($account_id));
36
-else if ($var['task'] == 'reset_email')
37
+} else if ($var['task'] == 'reset_email') {
37 38
 	$db->query('UPDATE album SET email = \'\' WHERE account_id =' . $db->escapeNumber($account_id));
38
-else if ($var['task'] == 'reset_website')
39
+} else if ($var['task'] == 'reset_website') {
39 40
 	$db->query('UPDATE album SET website = \'\' WHERE account_id = ' . $db->escapeNumber($account_id));
40
-else if ($var['task'] == 'reset_birthdate')
41
+} else if ($var['task'] == 'reset_birthdate') {
41 42
 	$db->query('UPDATE album SET day = 0, month = 0, year = 0 WHERE account_id = ' . $db->escapeNumber($account_id));
42
-else if ($var['task'] == 'reset_other')
43
+} else if ($var['task'] == 'reset_other') {
43 44
 	$db->query('UPDATE album SET other = \'\' WHERE account_id = ' . $db->escapeNumber($account_id));
44
-else if ($var['task'] == 'delete_comment') {
45
+} else if ($var['task'] == 'delete_comment') {
45 46
 	$comment_ids = $_REQUEST['comment_ids'];
46 47
 	// we just ignore if nothing was set
47 48
 	if (count($comment_ids) > 0) {
@@ -50,8 +51,7 @@  discard block
 block discarded – undo
50 51
 					WHERE album_id = '.$db->escapeNumber($account_id) . ' AND
51 52
 						  comment_id IN ('.$db->escapeArray($comment_ids) . ')');
52 53
 	}
53
-}
54
-else {
54
+} else {
55 55
 	create_error('No action chosen!');
56 56
 }
57 57
 
Please login to merge, or discard this patch.
admin/Default/album_moderate.php 1 patch
Braces   +10 added lines, -8 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 		$approved[$accountId] = get_album_nick($accountId);
20 20
 	}
21 21
 	$template->assign('Approved', $approved);
22
-}
23
-else {
22
+} else {
24 23
 	// check if the given account really has an entry
25 24
 	$db->query('SELECT * FROM album WHERE account_id = ' . $db->escapeNumber($account_id) . ' AND Approved = \'YES\'');
26 25
 	if ($db->nextRecord()) {
@@ -36,12 +35,15 @@  discard block
 block discarded – undo
36 35
 		create_error('This User doesn\'t have an album entry or it needs to be approved first!');
37 36
 	}
38 37
 
39
-	if (!empty($day) && !empty($month) && !empty($year))
40
-		$birthdate = $month . ' / ' . $day . ' / ' . $year;
41
-	if (empty($birthdate) && !empty($year))
42
-		$birthdate = 'Year ' . $year;
43
-	if (empty($birthdate))
44
-		$birthdate = 'N/A';
38
+	if (!empty($day) && !empty($month) && !empty($year)) {
39
+			$birthdate = $month . ' / ' . $day . ' / ' . $year;
40
+	}
41
+	if (empty($birthdate) && !empty($year)) {
42
+			$birthdate = 'Year ' . $year;
43
+	}
44
+	if (empty($birthdate)) {
45
+			$birthdate = 'N/A';
46
+	}
45 47
 
46 48
 	$entry = [
47 49
 		'disabled' => $disabled,
Please login to merge, or discard this patch.
templates/Default/engine/Default/includes/Head.inc 1 patch
Braces   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,8 @@
 block discarded – undo
1 1
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
2
-<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) echo ": $GameName"; ?></title>
2
+<title><?php echo PAGE_TITLE; ?><?php if (isset($GameName)) {
3
+	echo ": $GameName";
4
+}
5
+?></title>
3 6
 <meta http-equiv="pragma" content="no-cache" /><?php
4 7
 if (!is_object($ThisAccount) || $ThisAccount->isDefaultCSSEnabled()) { ?>
5 8
 	<link rel="stylesheet" type="text/css" href="<?php echo $CSSLink; ?>" />
Please login to merge, or discard this patch.
engine/Default/shop_goods.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,9 +50,9 @@
 block discarded – undo
50 50
 			//get base for ports that dont happen to trade that good
51 51
 			$GOODS = Globals::getGoods();
52 52
 			$fine = $totalFine = $port->getLevel() *
53
-			    (($ship->getCargo(GOODS_SLAVES) * $GOODS[GOODS_SLAVES]['BasePrice']) +
54
-			     ($ship->getCargo(GOODS_WEAPONS) * $GOODS[GOODS_WEAPONS]['BasePrice']) +
55
-			     ($ship->getCargo(GOODS_NARCOTICS) * $GOODS[GOODS_NARCOTICS]['BasePrice']));
53
+				(($ship->getCargo(GOODS_SLAVES) * $GOODS[GOODS_SLAVES]['BasePrice']) +
54
+				 ($ship->getCargo(GOODS_WEAPONS) * $GOODS[GOODS_WEAPONS]['BasePrice']) +
55
+				 ($ship->getCargo(GOODS_NARCOTICS) * $GOODS[GOODS_NARCOTICS]['BasePrice']));
56 56
 			$player->increaseHOF($ship->getCargo(GOODS_SLAVES) + $ship->getCargo(GOODS_WEAPONS) + $ship->getCargo(GOODS_NARCOTICS), array('Trade', 'Search', 'Caught', 'Goods Confiscated'), HOF_PUBLIC);
57 57
 			$player->increaseHOF($totalFine, array('Trade', 'Search', 'Caught', 'Amount Fined'), HOF_PUBLIC);
58 58
 			$template->assign('TotalFine', $totalFine);
Please login to merge, or discard this patch.
Braces   +17 added lines, -15 removed lines patch added patch discarded remove patch
@@ -6,8 +6,9 @@  discard block
 block discarded – undo
6 6
 $port = $player->getSectorPort();
7 7
 
8 8
 $tradeable = checkPortTradeable($port, $player);
9
-if ($tradeable !== true)
9
+if ($tradeable !== true) {
10 10
 	create_error($tradeable);
11
+}
11 12
 
12 13
 // topic
13 14
 $template->assign('PageTopic', 'Port In Sector #' . $player->getSectorID());
@@ -23,17 +24,19 @@  discard block
 block discarded – undo
23 24
 //The player is sent here after trading and sees this if his offer is accepted.
24 25
 if (!empty($var['trade_msg'])) {
25 26
 	$template->assign('TradeMsg', $var['trade_msg']);
26
-}
27
-elseif ($player->getLastPort() != $player->getSectorID()) {
27
+} elseif ($player->getLastPort() != $player->getSectorID()) {
28 28
 	// test if we are searched, but only if we hadn't a previous trade here
29 29
 
30 30
 	$base_chance = 15;
31
-	if ($port->hasGood(GOODS_SLAVES))
32
-		$base_chance -= 4;
33
-	if ($port->hasGood(GOODS_WEAPONS))
34
-		$base_chance -= 4;
35
-	if ($port->hasGood(GOODS_NARCOTICS))
36
-		$base_chance -= 4;
31
+	if ($port->hasGood(GOODS_SLAVES)) {
32
+			$base_chance -= 4;
33
+	}
34
+	if ($port->hasGood(GOODS_WEAPONS)) {
35
+			$base_chance -= 4;
36
+	}
37
+	if ($port->hasGood(GOODS_NARCOTICS)) {
38
+			$base_chance -= 4;
39
+	}
37 40
 
38 41
 	if ($ship->isUnderground()) {
39 42
 		$base_chance -= 4;
@@ -64,11 +67,11 @@  discard block
 block discarded – undo
64 67
 					// because credits is 0 it will take money from bank
65 68
 					$player->decreaseBank(min($fine, $player->getBank()));
66 69
 					// leave insurance
67
-					if ($player->getBank() < 5000)
68
-						$player->setBank(5000);
70
+					if ($player->getBank() < 5000) {
71
+											$player->setBank(5000);
72
+					}
69 73
 				}
70
-			}
71
-			else {
74
+			} else {
72 75
 				$player->decreaseCredits($fine);
73 76
 			}
74 77
 
@@ -80,8 +83,7 @@  discard block
 block discarded – undo
80 83
 			$ship->setCargo(GOODS_NARCOTICS, 0);
81 84
 			$account->log(LOG_TYPE_TRADING, 'Player gets caught with illegals', $player->getSectorID());
82 85
 
83
-		}
84
-		else {
86
+		} else {
85 87
 			$template->assign('IllegalsFound', false);
86 88
 			$player->increaseHOF(1, array('Trade', 'Search', 'Times Found Innocent'), HOF_PUBLIC);
87 89
 			$player->increaseAlignment(1);
Please login to merge, or discard this patch.
engine/Default/sector_jump_processing.php 1 patch
Braces   +20 added lines, -13 removed lines patch added patch discarded remove patch
@@ -4,8 +4,11 @@  discard block
 block discarded – undo
4 4
 	create_error('You cannot move until the game has started!');
5 5
 }
6 6
 
7
-if (isset($_REQUEST['target'])) $target = trim($_REQUEST['target']);
8
-else $target = $var['target'];
7
+if (isset($_REQUEST['target'])) {
8
+	$target = trim($_REQUEST['target']);
9
+} else {
10
+	$target = $var['target'];
11
+}
9 12
 
10 13
 //allow hidden players (admins that don't play) to move without pinging, hitting mines, losing turns
11 14
 if (in_array($player->getAccountID(), Globals::getHiddenPlayers())) {
@@ -20,18 +23,22 @@  discard block
 block discarded – undo
20 23
 }
21 24
 
22 25
 // you can't move while on planet
23
-if ($player->isLandedOnPlanet())
26
+if ($player->isLandedOnPlanet()) {
24 27
 	create_error('You are on a planet! You must launch first!');
28
+}
25 29
 
26 30
 // if no 'target' is given we forward to plot
27
-if (empty($target))
31
+if (empty($target)) {
28 32
 	create_error('Where do you want to go today?');
33
+}
29 34
 
30
-if (!is_numeric($target))
35
+if (!is_numeric($target)) {
31 36
 	create_error('Please enter only numbers!');
37
+}
32 38
 	
33
-if ($player->getSectorID() == $target)
39
+if ($player->getSectorID() == $target) {
34 40
 	create_error('Hmmmm...if ' . $player->getSectorID() . '=' . $target . ' then that means...YOU\'RE ALREADY THERE! *cough*you\'re real smart*cough*');
41
+}
35 42
 
36 43
 if (!SmrSector::sectorExists($player->getGameID(), $target)) {
37 44
 	create_error('The target sector doesn\'t exist!');
@@ -60,8 +67,9 @@  discard block
 block discarded – undo
60 67
 $maxMisjump = $jumpInfo['max_misjump'];
61 68
 
62 69
 // check for turns
63
-if ($player->getTurns() < $turnsToJump)
70
+if ($player->getTurns() < $turnsToJump) {
64 71
 	create_error('You don\'t have enough turns for that jump!');
72
+}
65 73
 
66 74
 // send scout msg
67 75
 $sector->leavingSector($player, MOVEMENT_JUMP);
@@ -76,12 +84,12 @@  discard block
 block discarded – undo
76 84
 	}
77 85
 		
78 86
 	$misjumpSector = array_rand($distances[$misjump]);
79
-	if ($misjumpSector == null)
80
-		throw new Exception('Misjump sector is null, distances: ' . var_export($distances, true));
87
+	if ($misjumpSector == null) {
88
+			throw new Exception('Misjump sector is null, distances: ' . var_export($distances, true));
89
+	}
81 90
 	$player->setSectorID($misjumpSector);
82 91
 	unset($distances);
83
-}
84
-else { // we hit it. exactly
92
+} else { // we hit it. exactly
85 93
 	$player->setSectorID($targetSector->getSectorID());
86 94
 }
87 95
 $player->takeTurns($turnsToJump, $turnsToJump);
@@ -118,8 +126,7 @@  discard block
 block discarded – undo
118 126
 		$container = create_container('skeleton.php', 'current_sector.php');
119 127
 		$container['msg'] = 'You have just flown past a sprinkle of mines.<br />Because of your newbie status you have been spared from the harsh reality of the forces.';
120 128
 		forward($container);
121
-	}
122
-	else {
129
+	} else {
123 130
 		$container = create_container('forces_attack_processing.php');
124 131
 		$container['action'] = 'bump';
125 132
 		$container['owner_id'] = $mineOwnerID;
Please login to merge, or discard this patch.
admin/Default/location_edit.php 1 patch
Braces   +19 added lines, -14 removed lines patch added patch discarded remove patch
@@ -5,21 +5,27 @@  discard block
 block discarded – undo
5 5
 if (isset($var['location_type_id'])) {
6 6
 	$location = SmrLocation::getLocation($var['location_type_id']);
7 7
 	if (isset($_REQUEST['save'])) {
8
-		if ($_REQUEST['add_ship_id'] != 0)
9
-			$location->addShipSold($_REQUEST['add_ship_id']);
10
-		if ($_REQUEST['add_weapon_id'] != 0)
11
-			$location->addWeaponSold($_REQUEST['add_weapon_id']);
12
-		if ($_REQUEST['add_hardware_id'] != 0)
13
-			$location->addHardwareSold($_REQUEST['add_hardware_id']);
14
-		if (isset($_REQUEST['remove_ships']) && is_array($_REQUEST['remove_ships']))
15
-			foreach ($_REQUEST['remove_ships'] as $shipTypeID)
8
+		if ($_REQUEST['add_ship_id'] != 0) {
9
+					$location->addShipSold($_REQUEST['add_ship_id']);
10
+		}
11
+		if ($_REQUEST['add_weapon_id'] != 0) {
12
+					$location->addWeaponSold($_REQUEST['add_weapon_id']);
13
+		}
14
+		if ($_REQUEST['add_hardware_id'] != 0) {
15
+					$location->addHardwareSold($_REQUEST['add_hardware_id']);
16
+		}
17
+		if (isset($_REQUEST['remove_ships']) && is_array($_REQUEST['remove_ships'])) {
18
+					foreach ($_REQUEST['remove_ships'] as $shipTypeID)
16 19
 				$location->removeShipSold($shipTypeID);
17
-		if (isset($_REQUEST['remove_weapons']) && is_array($_REQUEST['remove_weapons']))
18
-			foreach ($_REQUEST['remove_weapons'] as $weaponTypeID)
20
+		}
21
+		if (isset($_REQUEST['remove_weapons']) && is_array($_REQUEST['remove_weapons'])) {
22
+					foreach ($_REQUEST['remove_weapons'] as $weaponTypeID)
19 23
 				$location->removeWeaponSold($weaponTypeID);
20
-		if (isset($_REQUEST['remove_hardware']) && is_array($_REQUEST['remove_hardware']))
21
-			foreach ($_REQUEST['remove_hardware'] as $hardwareTypeID)
24
+		}
25
+		if (isset($_REQUEST['remove_hardware']) && is_array($_REQUEST['remove_hardware'])) {
26
+					foreach ($_REQUEST['remove_hardware'] as $hardwareTypeID)
22 27
 				$location->removeHardwareSold($hardwareTypeID);
28
+		}
23 29
 
24 30
 		$location->setFed(isset($_REQUEST['fed']));
25 31
 		$location->setBar(isset($_REQUEST['bar']));
@@ -41,7 +47,6 @@  discard block
 block discarded – undo
41 47
 														'Name' => $db->getField('hardware_name'));
42 48
 	}
43 49
 	$template->assign('AllHardware', $hardware);
44
-}
45
-else {
50
+} else {
46 51
 	$template->assign('Locations', SmrLocation::getAllLocations());
47 52
 }
Please login to merge, or discard this patch.