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
Push — master ( 184b43...eba83e )
by Dan
05:10
created
lib/Default/ChessPiece.class.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -91,8 +91,7 @@  discard block
 block discarded – undo
91 91
 						}
92 92
 					}
93 93
 				}
94
-			}
95
-			else if($this->pieceID==self::KING) {
94
+			} else if($this->pieceID==self::KING) {
96 95
 				for($i = -1; $i < 2; $i++) {
97 96
 					for($j = -1; $j < 2; $j++) {
98 97
 						if($i!=0 || $j!=0) {
@@ -114,8 +113,7 @@  discard block
 block discarded – undo
114 113
 						$this->addMove($this->x+2, $this->y, $board, $moves, $hasMoved, $attackingCheck);
115 114
 					}
116 115
 				}
117
-			}
118
-			else if($this->pieceID==self::QUEEN) {
116
+			} else if($this->pieceID==self::QUEEN) {
119 117
 				$moveX = $this->x;
120 118
 				$moveY = $this->y;
121 119
 				while($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
@@ -140,8 +138,7 @@  discard block
 block discarded – undo
140 138
 				$moveX = $this->x;
141 139
 				$moveY = $this->y;
142 140
 				while($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
143
-			}
144
-			else if($this->pieceID==self::ROOK) {
141
+			} else if($this->pieceID==self::ROOK) {
145 142
 				$moveX = $this->x;
146 143
 				$moveY = $this->y;
147 144
 				while($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
@@ -154,8 +151,7 @@  discard block
 block discarded – undo
154 151
 				$moveX = $this->x;
155 152
 				$moveY = $this->y;
156 153
 				while($this->addMove($moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down
157
-			}
158
-			else if($this->pieceID==self::BISHOP) {
154
+			} else if($this->pieceID==self::BISHOP) {
159 155
 				$moveX = $this->x;
160 156
 				$moveY = $this->y;
161 157
 				while($this->addMove(--$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
@@ -168,8 +164,7 @@  discard block
 block discarded – undo
168 164
 				$moveX = $this->x;
169 165
 				$moveY = $this->y;
170 166
 				while($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
171
-			}
172
-			else if($this->pieceID==self::KNIGHT) {
167
+			} else if($this->pieceID==self::KNIGHT) {
173 168
 				$moveX = $this->x-1;
174 169
 				$moveY = $this->y-2;
175 170
 				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2up-left
Please login to merge, or discard this patch.
lib/Default/DummyShip.class.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,8 +72,7 @@
 block discarded – undo
72 72
 				$return = unserialize($db->getField('info'));
73 73
 				$return->regenerate($player);
74 74
 				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] =& $return;
75
-			}
76
-			else {
75
+			} else {
77 76
 				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = new DummyShip($player);
78 77
 			}
79 78
 		}
Please login to merge, or discard this patch.
lib/Default/Sorter.class.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,9 @@
 block discarded – undo
20 20
 	}
21 21
 
22 22
 	public static function cmpNum($a, $b) {
23
-		if($a == $b) return 0;
23
+		if($a == $b) {
24
+			return 0;
25
+		}
24 26
 		return (self::$reverseOrder?-1:1)*($a < $b ? -1 : 1);
25 27
 	}
26 28
 
Please login to merge, or discard this patch.
lib/Default/ChessGame.class.php 1 patch
Braces   +13 added lines, -26 removed lines patch added patch discarded remove patch
@@ -81,8 +81,7 @@  discard block
 block discarded – undo
81 81
 			$this->blackID = $this->db->getInt('black_id');
82 82
 			$this->winner = $this->db->getInt('winner_id');
83 83
 			$this->resetHasMoved();
84
-		}
85
-		else {
84
+		} else {
86 85
 			throw new Exception('Chess game not found: ' . $chessGameID);
87 86
 		}
88 87
 	}
@@ -149,8 +148,7 @@  discard block
 block discarded – undo
149 148
 					break;
150 149
 				}
151 150
 			}
152
-		}
153
-		catch(Exception $e) {
151
+		} catch(Exception $e) {
154 152
 			if($debugInfo === true) {
155 153
 				echo $e->getMessage() . EOL . $e->getTraceAsString() . EOL;
156 154
 			}
@@ -189,11 +187,9 @@  discard block
 block discarded – undo
189 187
 			if(!$mate && $this->hasEnded()) {
190 188
 				if($this->getWinner() != 0) {
191 189
 					$this->moves[] = ($this->getWinner() == $this->getWhiteID() ? 'Black' : 'White') . ' Resigned.';
192
-				}
193
-				else if(count($this->moves) < 2) {
190
+				} else if(count($this->moves) < 2) {
194 191
 					$this->moves[] = 'Game Cancelled.';
195
-				}
196
-				else {
192
+				} else {
197 193
 					$this->moves[] = 'Game Drawn.';
198 194
 				}
199 195
 			}
@@ -212,8 +208,7 @@  discard block
 block discarded – undo
212 208
 			for($x=0; $x < 8; $x++) {
213 209
 				if($board[$y][$x] == null) {
214 210
 					$blanks++;
215
-				}
216
-				else {
211
+				} else {
217 212
 					if($blanks > 0) {
218 213
 						$fen .= $blanks;
219 214
 						$blanks = 0;
@@ -268,8 +263,7 @@  discard block
 block discarded – undo
268 263
 					$fen .= '3';
269 264
 				break;
270 265
 			}
271
-		}
272
-		else {
266
+		} else {
273 267
 			$fen .= '-';
274 268
 		}
275 269
 		$fen .= ' 0 ' . floor(count($this->moves)/2);
@@ -386,8 +380,7 @@  discard block
 block discarded – undo
386 380
 		}
387 381
 		if($pieceID == ChessPiece::PAWN && ($startY == 1 || $startY == 6) && ($endY == 3 || $endY == 4)) {
388 382
 			$this->hasMoved[ChessPiece::PAWN] = array($endX, $endY);
389
-		}
390
-		else {
383
+		} else {
391 384
 			$this->hasMoved[ChessPiece::PAWN] = array(-1,-1);
392 385
 		}
393 386
 		return ($castling == 'Queen' ? '0-0-0' : ($castling == 'King' ? '0-0' : ''))
@@ -493,8 +486,7 @@  discard block
 block discarded – undo
493 486
 				$board[$toY][$castling['ToX']]->setX($castling['ToX']);
494 487
 				$board[$y][$castling['X']] = null;
495 488
 			}
496
-		}
497
-		else if($p->pieceID == ChessPiece::PAWN) {
489
+		} else if($p->pieceID == ChessPiece::PAWN) {
498 490
 			if($toY == 0 || $toY == 7) {
499 491
 				$pawnPromotion = $p->promote($pawnPromotionPiece, $board);
500 492
 			}
@@ -512,8 +504,7 @@  discard block
 block discarded – undo
512 504
 				}
513 505
 				$board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]] = null;
514 506
 			}
515
-		}
516
-		else if($p->pieceID == ChessPiece::ROOK && ($x == 0 || $x == 7) && $y == ($p->colour == self::PLAYER_WHITE ? 7 : 0)) {
507
+		} else if($p->pieceID == ChessPiece::ROOK && ($x == 0 || $x == 7) && $y == ($p->colour == self::PLAYER_WHITE ? 7 : 0)) {
517 508
 			//Rook moved?
518 509
 			if($hasMoved[$p->colour][ChessPiece::ROOK][$x==0?'Queen':'King'] === false) {
519 510
 				// We set rook moved in here as it's used for move info.
@@ -573,12 +564,10 @@  discard block
 block discarded – undo
573 564
 				$board[$y][$castling['X']]->setX($castling['X']);
574 565
 				$board[$toY][$castling['ToX']] = null;
575 566
 			}
576
-		}
577
-		else if($moveInfo['EnPassant'] === true) {
567
+		} else if($moveInfo['EnPassant'] === true) {
578 568
 			$board[$toY][$toX] = null;
579 569
 			$board[$hasMoved[ChessPiece::PAWN][1]][$hasMoved[ChessPiece::PAWN][0]] = $moveInfo['PieceTaken'];
580
-		}
581
-		else if($moveInfo['RookMoved'] !== false) {
570
+		} else if($moveInfo['RookMoved'] !== false) {
582 571
 			$hasMoved[$p->colour][ChessPiece::ROOK][$moveInfo['RookMoved']] = false;
583 572
 		}
584 573
 		if($moveInfo['RookTaken'] !== false) {
@@ -702,8 +691,7 @@  discard block
 block discarded – undo
702 691
 					$this->setWinner($forAccountID);
703 692
 					$return = 1;
704 693
 					SmrPlayer::sendMessageFromCasino($lastTurnPlayer->getGameID(), $this->getCurrentTurnAccountID(), 'You have just lost [chess=' . $this->getChessGameID() . '] against [player=' . $lastTurnPlayer->getPlayerID() . '].');
705
-				}
706
-				else {
694
+				} else {
707 695
 					SmrPlayer::sendMessageFromCasino($lastTurnPlayer->getGameID(), $this->getCurrentTurnAccountID(), 'It is now your turn in [chess=' . $this->getChessGameID() . '] against [player=' . $lastTurnPlayer->getPlayerID() . '].');
708 696
 					if($checking == 'CHECK') {
709 697
 						$currentPlayer->increaseHOF(1, array($chessType,'Moves','Check Given'), HOF_PUBLIC);
@@ -853,8 +841,7 @@  discard block
 block discarded – undo
853 841
 							SET end_time=' . $this->db->escapeNumber(TIME) . '
854 842
 							WHERE chess_game_id=' . $this->db->escapeNumber($this->chessGameID) . ';');
855 843
 			return 1;
856
-		}
857
-		else {
844
+		} else {
858 845
 			$loserColour = $this->getColourForAccountID($accountID);
859 846
 			$winnerAccountID = $this->getColourID(self::getOtherColour($loserColour));
860 847
 			$results = $this->setWinner($winnerAccountID);
Please login to merge, or discard this patch.
lib/Default/DummyPlayer.class.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 	}
54 54
 	
55 55
 	public function setAllianceID($ID) {
56
-		if($this->allianceID == $ID)
57
-			return;
56
+		if($this->allianceID == $ID) {
57
+					return;
58
+		}
58 59
 		$this->allianceID=$ID;
59 60
 	}
60 61
 	
@@ -93,8 +94,7 @@  discard block
 block discarded – undo
93 94
 		if($db->nextRecord()) {
94 95
 			$return = unserialize($db->getField('info'));
95 96
 			return $return;
96
-		}
97
-		else {
97
+		} else {
98 98
 			$return = new DummyPlayer();
99 99
 			return $return;
100 100
 		}
Please login to merge, or discard this patch.
htdocs/login.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,6 @@
 block discarded – undo
50 50
 	$template->assign('Body', 'login/login.php');
51 51
 	$template->display('login/skeleton.php');
52 52
 
53
-}
54
-catch (Throwable $e) {
53
+} catch (Throwable $e) {
55 54
 	handleException($e);
56 55
 }
Please login to merge, or discard this patch.
lib/Default/SmrSession.class.php 1 patch
Braces   +9 added lines, -18 removed lines patch added patch discarded remove patch
@@ -156,8 +156,7 @@  discard block
 block discarded – undo
156 156
 		// now try the cookie
157 157
 		if (isset($_COOKIE['session_id']) && strlen($_COOKIE['session_id']) === 32) {
158 158
 			self::$session_id = $_COOKIE['session_id'];
159
-		}
160
-		else {
159
+		} else {
161 160
 			// create a new session id
162 161
 			do {
163 162
 				self::$session_id = md5(uniqid(strval(rand())));
@@ -211,18 +210,15 @@  discard block
 block discarded – undo
211 210
 				self::$account_id = 0;
212 211
 				self::$game_id = 0;
213 212
 				self::$var = array();
214
-			}
215
-			else {
213
+			} else {
216 214
 				foreach (self::$var as $key => &$value) {
217 215
 					if ($value['Expires'] > 0 && $value['Expires'] <= TIME) { // Use 0 for infinity
218 216
 						//This link is no longer valid
219 217
 						unset(self::$var[$key]);
220
-					}
221
-					else if ($value['RemainingPageLoads'] < 0) {
218
+					} else if ($value['RemainingPageLoads'] < 0) {
222 219
 						//This link is no longer valid
223 220
 						unset(self::$var[$key]);
224
-					}
225
-					else {
221
+					} else {
226 222
 						--$value['RemainingPageLoads'];
227 223
 						if (isset($value['CommonID'])) {
228 224
 							self::$commonIDs[$value['CommonID']] = $key;
@@ -230,8 +226,7 @@  discard block
 block discarded – undo
230 226
 					}
231 227
 				} unset($value);
232 228
 			}
233
-		}
234
-		else {
229
+		} else {
235 230
 			self::$generate = true;
236 231
 			self::$account_id = 0;
237 232
 			self::$game_id = 0;
@@ -252,8 +247,7 @@  discard block
 block discarded – undo
252 247
 			self::$db->query('UPDATE active_session SET account_id=' . self::$db->escapeNumber(self::$account_id) . ',game_id=' . self::$db->escapeNumber(self::$game_id) . (!USING_AJAX ? ',last_accessed=' . self::$db->escapeNumber(TIME) : '') . ',session_var=' . self::$db->escapeBinary($compressed) .
253 248
 					',last_sn=' . self::$db->escapeString(self::$SN) .
254 249
 					' WHERE session_id=' . self::$db->escapeString(self::$session_id) . (USING_AJAX ? ' AND last_sn=' . self::$db->escapeString(self::$lastSN) : '') . ' LIMIT 1');
255
-		}
256
-		else {
250
+		} else {
257 251
 			self::$db->query('DELETE FROM active_session WHERE account_id = ' . self::$db->escapeNumber(self::$account_id) . ' AND game_id = ' . self::$db->escapeNumber(self::$game_id));
258 252
 			self::$db->query('INSERT INTO active_session (session_id, account_id, game_id, last_accessed, session_var) VALUES(' . self::$db->escapeString(self::$session_id) . ',' . self::$db->escapeNumber(self::$account_id) . ',' . self::$db->escapeNumber(self::$game_id) . ',' . self::$db->escapeNumber(TIME) . ',' . self::$db->escapeBinary($compressed) . ')');
259 253
 			self::$generate = false;
@@ -400,8 +394,7 @@  discard block
 block discarded – undo
400 394
 		if ($value === null) {
401 395
 			unset($var[$key]);
402 396
 			unset(self::$var[self::$SN][$key]);
403
-		}
404
-		else {
397
+		} else {
405 398
 			$var[$key] = $value;
406 399
 			self::$var[self::$SN][$key] = $value;
407 400
 		}
@@ -423,8 +416,7 @@  discard block
 block discarded – undo
423 416
 
424 417
 		if ($sn === false) {
425 418
 			$sn = self::generateSN($container);
426
-		}
427
-		else {
419
+		} else {
428 420
 			// If we've been provided an SN to use then copy over the existing 'PreviousRequestTime'
429 421
 			$container['PreviousRequestTime'] = self::$var[$sn]['PreviousRequestTime'];
430 422
 		}
@@ -437,8 +429,7 @@  discard block
 block discarded – undo
437 429
 		if (isset(self::$commonIDs[$container['CommonID']])) {
438 430
 			$sn = self::$commonIDs[$container['CommonID']];
439 431
 			$container['PreviousRequestTime'] = isset(self::$var[$sn]) ? self::$var[$sn]['PreviousRequestTime'] : MICRO_TIME;
440
-		}
441
-		else {
432
+		} else {
442 433
 			do {
443 434
 				$sn = substr(md5(strval(rand())), 0, 8);
444 435
 			} while (isset(self::$var[$sn]));
Please login to merge, or discard this patch.
engine/Default/help.inc 1 patch
Braces   +30 added lines, -22 removed lines patch added patch discarded remove patch
@@ -22,16 +22,18 @@  discard block
 block discarded – undo
22 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
-		if (!$db2->getNumRows())
26
-			$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
25
+		if (!$db2->getNumRows()) {
26
+					$db2->query('SELECT * FROM manual WHERE topic_id = '.$db2->escapeNumber($parent_topic_id));
27
+		}
27 28
 
28 29
 		echo ('<th width="32">');
29 30
 		if ($db2->nextRecord()) {
30 31
 			$previous_topic_id = $db2->getInt('topic_id');
31 32
 			$previous_topic = stripslashes($db2->getField('topic'));
32 33
 			echo ('<a href="/manual.php?'.$previous_topic_id.'"><img src="/images/help/previous.jpg" width="32" height="32" border="0"></a>');
33
-		} else
34
-			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
34
+		} else {
35
+					echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
36
+		}
35 37
 		echo ('</th>');
36 38
 
37 39
 		// **************************
@@ -43,8 +45,9 @@  discard block
 block discarded – undo
43 45
 			$up_topic_id = $db2->getInt('topic_id');
44 46
 			$up_topic = stripslashes($db2->getField('topic'));
45 47
 			echo ('<a href="/manual.php?'.$up_topic_id.'"><img src="/images/help/up.jpg" width="32" height="32" border="0"></a>');
46
-		} else
47
-			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
48
+		} else {
49
+					echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
50
+		}
48 51
 		echo ('</th>');
49 52
 
50 53
 		// **************************
@@ -52,8 +55,9 @@  discard block
 block discarded – undo
52 55
 		// **************************
53 56
 		$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($topic_id).' AND order_id = 1');
54 57
 
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));
58
+		if (!$db2->getNumRows()) {
59
+					$db2->query('SELECT * FROM manual WHERE parent_topic_id = '.$db2->escapeNumber($parent_topic_id).' AND order_id = '.$db2->escapeNumber($order_id + 1));
60
+		}
57 61
 
58 62
 		$seenParentIDs = array(0);
59 63
 		$curr_parent_topic_id = $parent_topic_id;
@@ -72,8 +76,7 @@  discard block
 block discarded – undo
72 76
 			$next_topic_id = $db2->getInt('topic_id');
73 77
 			$next_topic = stripslashes($db2->getField('topic'));
74 78
 			echo ('<a href="/manual.php?'.$next_topic_id.'"><img src="/images/help/next.jpg" width="32" height="32" border="0"></a>');
75
-		}
76
-		else {
79
+		} else {
77 80
 			echo ('<img src="/images/help/empty.jpg" width="32" height="32">');
78 81
 		}
79 82
 		echo ('</th>');
@@ -85,18 +88,22 @@  discard block
 block discarded – undo
85 88
 
86 89
 		echo ('<tr>');
87 90
 		echo ('<td colspan="5">');
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;');
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;');
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>');
91
+		if (isset($previous_topic_id) && $previous_topic_id > 0) {
92
+					echo ('<b>Previous:</b> <a href="/manual.php?'.$previous_topic_id.'">' . get_numbering($previous_topic_id) . $previous_topic.'</a>&nbsp;&nbsp;&nbsp;');
93
+		}
94
+		if (isset($up_topic_id) && $up_topic_id > 0) {
95
+					echo ('<b>Up:</b> <a href="/manual.php?'.$up_topic_id.'">' . get_numbering($up_topic_id) . $up_topic.'</a>&nbsp;&nbsp;&nbsp;');
96
+		}
97
+		if (isset($next_topic_id) && $next_topic_id > 0) {
98
+					echo ('<b>Next:</b> <a href="/manual.php?'.$next_topic_id.'">' . get_numbering($next_topic_id) . $next_topic.'</a>');
99
+		}
94 100
 		echo ('</tr>');
95 101
 
96 102
 		echo ('</table>');
97
-	} else
98
-		echo ('Invalid Topic!');
99
-}
103
+	} else {
104
+			echo ('Invalid Topic!');
105
+	}
106
+	}
100 107
 
101 108
 function echo_content($topic_id) {
102 109
 	// database object
@@ -114,9 +121,10 @@  discard block
 block discarded – undo
114 121
 		echo ('<h1>' . get_numbering($topic_id) . $topic.'</h1>');
115 122
 		echo ('<p>'.$text.'<p>');
116 123
 		echo ('</div>');
117
-	} else
118
-		echo ('Invalid Topic!');
119
-}
124
+	} else {
125
+			echo ('Invalid Topic!');
126
+	}
127
+	}
120 128
 
121 129
 function echo_subsection($topic_id) {
122 130
 	// database object
Please login to merge, or discard this patch.
admin/Default/game_delete_processing.php 1 patch
Braces   +37 added lines, -17 removed lines patch added patch discarded remove patch
@@ -11,8 +11,7 @@  discard block
 block discarded – undo
11 11
 $action = $_REQUEST['action'];
12 12
 if ($_REQUEST['save'] == 'Yes') {
13 13
 	$save = true;
14
-}
15
-else {
14
+} else {
16 15
 	$save = false;
17 16
 }
18 17
 
@@ -42,8 +41,7 @@  discard block
 block discarded – undo
42 41
 				$mines = $db2->getInt('sum_m');
43 42
 				$cds = $db2->getInt('cds');
44 43
 				$sds = $db2->getInt('sds');
45
-			}
46
-			else {
44
+			} else {
47 45
 				$mines = 0;
48 46
 				$cds = 0;
49 47
 				$sds = 0;
@@ -143,16 +141,25 @@  discard block
 block discarded – undo
143 141
 			$owner = $db->getInt('owner_id');
144 142
 
145 143
 			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 1');
146
-			if ($db2->nextRecord()) $gens = $db2->getInt('amount');
147
-			else $gens = 0;
144
+			if ($db2->nextRecord()) {
145
+				$gens = $db2->getInt('amount');
146
+			} else {
147
+				$gens = 0;
148
+			}
148 149
 
149 150
 			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 2');
150
-			if ($db2->nextRecord()) $hangs = $db2->getInt('amount');
151
-			else $hangs = 0;
151
+			if ($db2->nextRecord()) {
152
+				$hangs = $db2->getInt('amount');
153
+			} else {
154
+				$hangs = 0;
155
+			}
152 156
 
153 157
 			$db2->query('SELECT * FROM planet_has_building WHERE game_id = '.$game_id.' AND sector_id = '.$sector.' AND construction_id = 3');
154
-			if ($db2->nextRecord()) $turs = $db2->getInt('amount');
155
-			else $turs = 0;
158
+			if ($db2->nextRecord()) {
159
+				$turs = $db2->getInt('amount');
160
+			} else {
161
+				$turs = 0;
162
+			}
156 163
 
157 164
 			// insert into history db
158 165
 			$history_db_sql[] = 'INSERT INTO planet (game_id, sector_id, owner_id, generators, hangers, turrets) VALUES ' .
@@ -189,14 +196,21 @@  discard block
 block discarded – undo
189 196
 			$smrCredits = 0;
190 197
 			$db2->query('SELECT sum(amount) as bounty_am, sum(smr_credits) as bounty_cred FROM bounty WHERE game_id = '.$game_id.' AND account_id = '.$acc_id.' AND claimer_id = 0');
191 198
 			if ($db2->nextRecord()) {
192
-				if (is_int($db2->getField('bounty_am'))) $amount = $db2->getInt('bounty_am');
193
-				if (is_int($db2->getField('bounty_cred'))) $smrCredits = $db2->getInt('bounty_cred');
199
+				if (is_int($db2->getField('bounty_am'))) {
200
+					$amount = $db2->getInt('bounty_am');
201
+				}
202
+				if (is_int($db2->getField('bounty_cred'))) {
203
+					$smrCredits = $db2->getInt('bounty_cred');
204
+				}
194 205
 
195 206
 			}
196 207
 
197 208
 			$db2->query('SELECT * FROM ship_has_name WHERE game_id = '.$game_id.' AND account_id = '.$acc_id);
198
-			if ($db2->nextRecord()) $ship_name = $db2->getField('ship_name');
199
-			else $ship_name = 'None';
209
+			if ($db2->nextRecord()) {
210
+				$ship_name = $db2->getField('ship_name');
211
+			} else {
212
+				$ship_name = 'None';
213
+			}
200 214
 
201 215
 			// insert into history db
202 216
 			$history_db_sql[] = 'INSERT INTO player (account_id, game_id, player_name, player_id, experience, ship, race, alignment, alliance_id, kills, deaths, bounty, bounty_cred, ship_name) ' .
@@ -244,9 +258,15 @@  discard block
 block discarded – undo
244 258
 				$mines = $db2->getInt('sum_mines');
245 259
 				$cds = $db2->getInt('cds');
246 260
 				$sds = $db2->getInt('sds');
247
-				if (!is_numeric($mines)) $mines = 0;
248
-				if (!is_numeric($cds)) $cds = 0;
249
-				if (!is_numeric($sds)) $sds = 0;
261
+				if (!is_numeric($mines)) {
262
+					$mines = 0;
263
+				}
264
+				if (!is_numeric($cds)) {
265
+					$cds = 0;
266
+				}
267
+				if (!is_numeric($sds)) {
268
+					$sds = 0;
269
+				}
250 270
 
251 271
 			} else {
252 272
 
Please login to merge, or discard this patch.