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
Pull Request — master (#1006)
by Dan
15:04
created
src/lib/Default/help.inc.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	$db3 = MySqlDatabase::getInstance();
8 8
 
9 9
 	// get current entry
10
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id));
10
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id));
11 11
 	if ($db->nextRecord()) {
12 12
 		$parent_topic_id = $db->getInt('parent_topic_id');
13 13
 		$order_id = $db->getInt('order_id');
@@ -19,17 +19,17 @@  discard block
 block discarded – undo
19 19
 		// **************************
20 20
 		// **  PREVIOUS
21 21
 		// **************************
22
-		$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id - 1));
22
+		$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id - 1));
23 23
 
24 24
 		// no result?
25 25
 		if (!$db2->getNumRows())
26
-			$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
26
+			$db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id));
27 27
 
28 28
 		echo ('<th width="32">');
29 29
 		if ($db2->nextRecord()) {
30 30
 			$previous_topic_id = $db2->getInt('topic_id');
31 31
 			$previous_topic = stripslashes($db2->getField('topic'));
32
-			echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>');
32
+			echo ('<a href="/manual.php?' . $previous_topic_id . '"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>');
33 33
 		} else
34 34
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
35 35
 		echo ('</th>');
@@ -37,12 +37,12 @@  discard block
 block discarded – undo
37 37
 		// **************************
38 38
 		// **  UP
39 39
 		// **************************
40
-		$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
40
+		$db2->query('SELECT * FROM manual WHERE topic_id = ' . $db2->escapeNumber($parent_topic_id));
41 41
 		echo ('<th width="32">');
42 42
 		if ($db2->nextRecord()) {
43 43
 			$up_topic_id = $db2->getInt('topic_id');
44 44
 			$up_topic = stripslashes($db2->getField('topic'));
45
-			echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>');
45
+			echo ('<a href="/manual.php?' . $up_topic_id . '"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>');
46 46
 		} else
47 47
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
48 48
 		echo ('</th>');
@@ -50,35 +50,35 @@  discard block
 block discarded – undo
50 50
 		// **************************
51 51
 		// **  NEXT
52 52
 		// **************************
53
-		$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1');
53
+		$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($topic_id) . ' AND order_id = 1');
54 54
 
55 55
 		if (!$db2->getNumRows())
56
-			$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1));
56
+			$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($order_id + 1));
57 57
 
58 58
 		$seenParentIDs = array(0);
59 59
 		$curr_parent_topic_id = $parent_topic_id;
60 60
 		while (!$db2->getNumRows() && !in_array($curr_parent_topic_id, $seenParentIDs)) {
61 61
 			$seenParentIDs[] = $curr_parent_topic_id;
62
-			$db3->query('SELECT * FROM manual WHERE topic_id = '.$db3->escapeNumber($parent_topic_id));
62
+			$db3->query('SELECT * FROM manual WHERE topic_id = ' . $db3->escapeNumber($parent_topic_id));
63 63
 			$db3->nextRecord();
64 64
 			$curr_order_id = $db3->getInt('order_id');
65 65
 			$curr_parent_topic_id = $db3->getInt('parent_topic_id');
66 66
 
67
-			$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($curr_order_id + 1));
67
+			$db2->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db2->escapeNumber($parent_topic_id) . ' AND order_id = ' . $db2->escapeNumber($curr_order_id + 1));
68 68
 		}
69 69
 
70 70
 		echo ('<th width="32">');
71 71
 		if ($db2->nextRecord()) {
72 72
 			$next_topic_id = $db2->getInt('topic_id');
73 73
 			$next_topic = stripslashes($db2->getField('topic'));
74
-			echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>');
74
+			echo ('<a href="/manual.php?' . $next_topic_id . '"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>');
75 75
 		}
76 76
 		else {
77 77
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
78 78
 		}
79 79
 		echo ('</th>');
80 80
 
81
-		echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic.'</th>');
81
+		echo ('<th width="100%" class="center" validn="middle" style="font-size:18pt;font-weight:bold;">' . get_numbering($topic_id) . $topic . '</th>');
82 82
 		echo ('<th width="32"><a href="/manual_toc.php"><img src="/images/help/contents.jpg" width="32" height="32" border="0"></a></th>');
83 83
 
84 84
 		echo ('</tr>');
@@ -86,11 +86,11 @@  discard block
 block discarded – undo
86 86
 		echo ('<tr>');
87 87
 		echo ('<td colspan="5">');
88 88
 		if (isset($previous_topic_id) && $previous_topic_id > 0)
89
-			echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a>&nbsp;&nbsp;&nbsp;');
89
+			echo ('<b>Previous:</b> <a href="/manual.php?' . $previous_topic_id . '">' . get_numbering($previous_topic_id) . $previous_topic . '</a>&nbsp;&nbsp;&nbsp;');
90 90
 		if (isset($up_topic_id) && $up_topic_id > 0)
91
-			echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a>&nbsp;&nbsp;&nbsp;');
91
+			echo ('<b>Up:</b> <a href="/manual.php?' . $up_topic_id . '">' . get_numbering($up_topic_id) . $up_topic . '</a>&nbsp;&nbsp;&nbsp;');
92 92
 		if (isset($next_topic_id) && $next_topic_id > 0)
93
-			echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>');
93
+			echo ('<b>Next:</b> <a href="/manual.php?' . $next_topic_id . '">' . get_numbering($next_topic_id) . $next_topic . '</a>');
94 94
 		echo ('</tr>');
95 95
 
96 96
 		echo ('</table>');
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	$db = MySqlDatabase::getInstance();
104 104
 
105 105
 	// get current entry
106
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$topic_id);
106
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $topic_id);
107 107
 	if ($db->nextRecord()) {
108 108
 		$parent_topic_id = $db->getInt('parent_topic_id');
109 109
 		$order_id = $db->getInt('order_id');
@@ -111,8 +111,8 @@  discard block
 block discarded – undo
111 111
 		$text = stripslashes($db->getField('text'));
112 112
 
113 113
 		echo ('<div id="help_content">');
114
-		echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>');
115
-		echo ('<p>'.$text.'<p>');
114
+		echo ('<h1>' . get_numbering($topic_id) . $topic . '</h1>');
115
+		echo ('<p>' . $text . '<p>');
116 116
 		echo ('</div>');
117 117
 	} else
118 118
 		echo ('Invalid Topic!');
@@ -121,9 +121,9 @@  discard block
 block discarded – undo
121 121
 function echo_subsection($topic_id) {
122 122
 	// database object
123 123
 	$db = MySqlDatabase::getInstance();
124
-	$return='';
124
+	$return = '';
125 125
 	// check if there are subsections
126
-	$db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id');
126
+	$db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id');
127 127
 	if ($db->getNumRows()) {
128 128
 		echo ('<hr noshade width="75%" size="1" class="center"/>');
129 129
 		echo ('<div id="help_menu">');
@@ -137,19 +137,19 @@  discard block
 block discarded – undo
137 137
 }
138 138
 
139 139
 function echo_menu($topic_id) {
140
-	$return='';
140
+	$return = '';
141 141
 	// database object
142 142
 	$db = MySqlDatabase::getInstance();
143 143
 
144
-	$db->query('SELECT * FROM manual WHERE parent_topic_id = '.$db->escapeNumber($topic_id).' ORDER BY order_id');
144
+	$db->query('SELECT * FROM manual WHERE parent_topic_id = ' . $db->escapeNumber($topic_id) . ' ORDER BY order_id');
145 145
 	if ($db->getNumRows()) {
146 146
 		echo ('<ul type="disc">');
147
-		while($db->nextRecord()) {
147
+		while ($db->nextRecord()) {
148 148
 			$sub_topic_id = $db->getInt('topic_id');
149 149
 			$order_id = $db->getInt('order_id');
150 150
 			$sub_topic = stripslashes($db->getField('topic'));
151 151
 
152
-			echo ('<li><a href="/manual.php?'.$sub_topic_id.'">' . get_numbering($sub_topic_id) . $sub_topic.'</a></li>');
152
+			echo ('<li><a href="/manual.php?' . $sub_topic_id . '">' . get_numbering($sub_topic_id) . $sub_topic . '</a></li>');
153 153
 			echo_menu($sub_topic_id);
154 154
 		}
155 155
 		echo ('</ul>');
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
 function get_numbering($topic_id) {
161 161
 	$db = MySqlDatabase::getInstance();
162 162
 
163
-	$db->query('SELECT * FROM manual WHERE topic_id = '.$db->escapeNumber($topic_id));
163
+	$db->query('SELECT * FROM manual WHERE topic_id = ' . $db->escapeNumber($topic_id));
164 164
 	if ($db->nextRecord()) {
165 165
 		$up_topic_id = $db->getInt('parent_topic_id');
166 166
 		$order_id = $db->getInt('order_id');
Please login to merge, or discard this patch.
src/admin/Default/1.6/game_create_processing.php 1 patch
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -18,8 +18,7 @@
 block discarded – undo
18 18
 if ($join === false) {
19 19
 	create_error('Join Date is not valid!');
20 20
 }
21
-$start = empty(Request::get('game_start')) ? $join :
22
-         DateTime::createFromFormat('d/m/Y|', Request::get('game_start'));
21
+$start = empty(Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Request::get('game_start'));
23 22
 if ($start === false) {
24 23
 	create_error('Start Date is not valid!');
25 24
 }
Please login to merge, or discard this patch.
src/tools/npc/chess.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@  discard block
 block discarded – undo
19 19
 		1 => array("pipe", "w")  // stdout is a pipe that the child will write to
20 20
 	);
21 21
 	$engine = proc_open(UCI_CHESS_ENGINE, $descriptorSpec, $pipes);
22
-	$toEngine =& $pipes[0];
23
-	$fromEngine =& $pipes[1];
22
+	$toEngine = & $pipes[0];
23
+	$fromEngine = & $pipes[1];
24 24
 
25 25
 	function readFromEngine($block = true) {
26 26
 		global $fromEngine;
@@ -84,5 +84,5 @@  discard block
 block discarded – undo
84 84
 function debug($message, $debugObject = null) {
85 85
 	global $account, $var, $db;
86 86
 	echo date('Y-m-d H:i:s - ') . $message . ($debugObject !== null ? EOL . var_export($debugObject, true) : '') . EOL;
87
-	$db->query('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', ' . (is_object($account) ? $account->getAccountID() : 0) . ',NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject,true)) . ',' . $db->escapeString(var_export($var, true)) . ')');
87
+	$db->query('INSERT INTO npc_logs (script_id, npc_id, time, message, debug_info, var) VALUES (' . (defined('SCRIPT_ID') ? SCRIPT_ID : 0) . ', ' . (is_object($account) ? $account->getAccountID() : 0) . ',NOW(),' . $db->escapeString($message) . ',' . $db->escapeString(var_export($debugObject, true)) . ',' . $db->escapeString(var_export($var, true)) . ')');
88 88
 }
Please login to merge, or discard this patch.
src/lib/Default/SmrPlanetType.class.php 1 patch
Spacing   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -79,12 +79,12 @@  discard block
 block discarded – undo
79 79
 			'exp_gain' => 540,
80 80
 		],
81 81
 	];
82
-	public function name()         { return "Terran Planet"; }
83
-	public function imageLink()    { return "images/planet1.png"; }
84
-	public function description()  { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; }
82
+	public function name() { return "Terran Planet"; }
83
+	public function imageLink() { return "images/planet1.png"; }
84
+	public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; }
85 85
 	public function maxAttackers() { return 10; }
86
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
87
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
86
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
87
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
88 88
 }
89 89
 
90 90
 class AridPlanet extends SmrPlanetType {
@@ -108,12 +108,12 @@  discard block
 block discarded – undo
108 108
 			'exp_gain' => 180,
109 109
 		],
110 110
 	];
111
-	public function name()         { return "Arid Planet"; }
112
-	public function imageLink()    { return "images/planet2.png"; }
113
-	public function description()  { return "A world mostly devoid of surface water, but capable of supporting life."; }
111
+	public function name() { return "Arid Planet"; }
112
+	public function imageLink() { return "images/planet2.png"; }
113
+	public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; }
114 114
 	public function maxAttackers() { return 5; }
115
-	public function maxLanded()    { return 5; }
116
-	public function menuOptions()  { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; }
115
+	public function maxLanded() { return 5; }
116
+	public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; }
117 117
 }
118 118
 
119 119
 class DwarfPlanet extends SmrPlanetType {
@@ -137,12 +137,12 @@  discard block
 block discarded – undo
137 137
 			'exp_gain' => 540,
138 138
 		],
139 139
 	];
140
-	public function name()         { return "Dwarf Planet"; }
141
-	public function imageLink()    { return "images/planet3.png"; }
142
-	public function description()  { return "A smaller than usual planet, with no native life present."; }
140
+	public function name() { return "Dwarf Planet"; }
141
+	public function imageLink() { return "images/planet3.png"; }
142
+	public function description() { return "A smaller than usual planet, with no native life present."; }
143 143
 	public function maxAttackers() { return 5; }
144
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
145
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
144
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
145
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
146 146
 }
147 147
 
148 148
 class ProtoPlanet extends SmrPlanetType {
@@ -178,12 +178,12 @@  discard block
 block discarded – undo
178 178
 			'exp_gain' => 540,
179 179
 		],
180 180
 	];
181
-	public function name()         { return "Protoplanet"; }
182
-	public function imageLink()    { return "images/planet5.png"; }
183
-	public function description()  { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; }
181
+	public function name() { return "Protoplanet"; }
182
+	public function imageLink() { return "images/planet5.png"; }
183
+	public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; }
184 184
 	public function maxAttackers() { return 5; }
185
-	public function maxLanded()    { return 5; }
186
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
185
+	public function maxLanded() { return 5; }
186
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
187 187
 }
188 188
 
189 189
 class DefenseWorld extends SmrPlanetType {
@@ -213,10 +213,10 @@  discard block
 block discarded – undo
213 213
 			'exp_gain' => 9,
214 214
 		],
215 215
 	];
216
-	public function name()         { return "Defense World"; }
217
-	public function imageLink()    { return "images/planet4.png"; }
218
-	public function description()  { return "A fully armed and operational battle station loaded with excessive firepower."; }
216
+	public function name() { return "Defense World"; }
217
+	public function imageLink() { return "images/planet4.png"; }
218
+	public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; }
219 219
 	public function maxAttackers() { return 10; }
220
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
221
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
220
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
221
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
222 222
 }
Please login to merge, or discard this patch.
src/lib/Default/Rankings.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
 		global $player, $db;
99 99
 		$offset = $minRank - 1;
100 100
 		$limit = $maxRank - $offset;
101
-		$db->query('SELECT alliance_id, alliance_' . $stat . ' AS amount FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT ' . $offset. ', ' . $limit);
101
+		$db->query('SELECT alliance_id, alliance_' . $stat . ' AS amount FROM alliance WHERE game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, alliance_name LIMIT ' . $offset . ', ' . $limit);
102 102
 		return self::collectAllianceRankings($db, $player, $offset);
103 103
 	}
104 104
 
Please login to merge, or discard this patch.
src/engine/Default/rankings_alliance_experience.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
 	$template->assign('OurRank', $ourRank);
26 26
 }
27 27
 
28
-$expRanks = function (int $minRank, int $maxRank) use ($player, $db) : array {
28
+$expRanks = function(int $minRank, int $maxRank) use ($player, $db) : array {
29 29
 	$offset = $minRank - 1;
30 30
 	$limit = $maxRank - $offset;
31 31
 	$db->query('SELECT alliance_id, COALESCE(SUM(experience), 0) amount
Please login to merge, or discard this patch.
src/engine/Default/rankings_alliance_profit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
 	$template->assign('OurRank', $ourRank);
29 29
 }
30 30
 
31
-$profitRanks = function (int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array {
31
+$profitRanks = function(int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array {
32 32
 	$offset = $minRank - 1;
33 33
 	$limit = $maxRank - $offset;
34 34
 	$db->query('SELECT alliance_id, COALESCE(SUM(amount), 0) amount
Please login to merge, or discard this patch.
src/engine/Default/rankings_player_profit.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 $totalPlayers = $player->getGame()->getTotalPlayers();
26 26
 
27
-$profitRanks = function (int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array {
27
+$profitRanks = function(int $minRank, int $maxRank) use ($player, $db, $profitTypeEscaped) : array {
28 28
 	$offset = $minRank - 1;
29 29
 	$limit = $maxRank - $offset;
30 30
 	$db->query('SELECT p.*, COALESCE(ph.amount,0) amount FROM player p LEFT JOIN player_hof ph ON p.account_id = ph.account_id AND p.game_id = ph.game_id AND ph.type = ' . $profitTypeEscaped . ' WHERE p.game_id = ' . $db->escapeNumber($player->getGameID()) . ' ORDER BY amount DESC, player_name ASC LIMIT ' . $offset . ', ' . $limit);
Please login to merge, or discard this patch.
src/admin/Default/notify_view.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@
 block discarded – undo
21 21
 	/**
22 22
 	 * @var $messagePlayer SmrPlayer | string
23 23
 	 */
24
-	$getName = function ($messagePlayer) use ($container, $account) : string {
24
+	$getName = function($messagePlayer) use ($container, $account) : string {
25 25
 		$name = $messagePlayer;
26 26
 		if ($messagePlayer instanceof SmrPlayer) {
27 27
 			$name = $messagePlayer->getAccount()->getLogin();
Please login to merge, or discard this patch.