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 (#812)
by Dan
04:13
created
htdocs/config.inc 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@
 block discarded – undo
69 69
 	if (!empty(BUG_REPORT_TO_ADDRESSES)) {
70 70
 		$mail = setupMailer();
71 71
 		$mail->Subject = (defined('PAGE_PREFIX') ? PAGE_PREFIX : '??? ') .
72
-		                 'Automatic Bug Report';
72
+						 'Automatic Bug Report';
73 73
 		$mail->setFrom('[email protected]');
74 74
 		$mail->Body = $message;
75 75
 		foreach (BUG_REPORT_TO_ADDRESSES as $toAddress) {
Please login to merge, or discard this patch.
lib/Default/PlayingCard.class.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -44,8 +44,8 @@
 block discarded – undo
44 44
 	 */
45 45
 	public function getValue() {
46 46
 		if ($this->rankID == self::RANK_JACK ||
47
-		    $this->rankID == self::RANK_QUEEN ||
48
-		    $this->rankID == self::RANK_KING) {
47
+			$this->rankID == self::RANK_QUEEN ||
48
+			$this->rankID == self::RANK_KING) {
49 49
 			return 10;
50 50
 		} elseif ($this->isAce()) {
51 51
 			return 11;
Please login to merge, or discard this patch.
lib/Default/AbstractSmrPlayer.class.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -242,9 +242,9 @@
 block discarded – undo
242 242
 	 */
243 243
 	public function canFight() {
244 244
 		return !($this->hasNewbieTurns() ||
245
-		         $this->isDead() ||
246
-		         $this->isLandedOnPlanet() ||
247
-		         $this->hasFederalProtection());
245
+				 $this->isDead() ||
246
+				 $this->isLandedOnPlanet() ||
247
+				 $this->hasFederalProtection());
248 248
 	}
249 249
 
250 250
 	public function setDead($bool) {
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -929,8 +929,8 @@  discard block
 block discarded – undo
929 929
 		}
930 930
 		self::$HOFVis[$hofType] = $visibility;
931 931
 
932
-		$hof =& $this->HOF;
933
-		$hofChanged =& $this->hasHOFChanged;
932
+		$hof = & $this->HOF;
933
+		$hofChanged = & $this->hasHOFChanged;
934 934
 		$new = false;
935 935
 		foreach ($typeList as $type) {
936 936
 			if (!isset($hofChanged[$type])) {
@@ -940,8 +940,8 @@  discard block
 block discarded – undo
940 940
 				$hof[$type] = array();
941 941
 				$new = true;
942 942
 			}
943
-			$hof =& $hof[$type];
944
-			$hofChanged =& $hofChanged[$type];
943
+			$hof = & $hof[$type];
944
+			$hofChanged = & $hofChanged[$type];
945 945
 		}
946 946
 		if ($hofChanged == null) {
947 947
 			$hofChanged = self::HOF_CHANGED;
@@ -1097,7 +1097,7 @@  discard block
 block discarded – undo
1097 1097
 	}
1098 1098
 
1099 1099
 	private function setupMissionStep($missionID) {
1100
-		$mission =& $this->missions[$missionID];
1100
+		$mission = & $this->missions[$missionID];
1101 1101
 		if ($mission['On Step'] >= count(MISSIONS[$missionID]['Steps'])) {
1102 1102
 			// Nothing to do if this mission is already completed
1103 1103
 			return;
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
 			'Starting Sector' => $this->getSectorID()
1143 1143
 		);
1144 1144
 
1145
-		$this->missions[$missionID] =& $mission;
1145
+		$this->missions[$missionID] = & $mission;
1146 1146
 		$this->setupMissionStep($missionID);
1147 1147
 		$this->rebuildMission($missionID);
1148 1148
 
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 
1202 1202
 	public function claimMissionReward($missionID) {
1203 1203
 		$this->getMissions();
1204
-		$mission =& $this->missions[$missionID];
1204
+		$mission = & $this->missions[$missionID];
1205 1205
 		if ($mission === false) {
1206 1206
 			throw new Exception('Unknown mission: ' . $missionID);
1207 1207
 		}
Please login to merge, or discard this patch.
lib/Default/ChessPiece.class.php 2 patches
Spacing   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -52,10 +52,10 @@  discard block
 block discarded – undo
52 52
 	}
53 53
 	
54 54
 	public function isAttacking(array &$board, array &$hasMoved, $king, $x = -1, $y = -1) {
55
-		$moves =& $this->getPossibleMoves($board, $hasMoved, null, true);
56
-		foreach($moves as &$move) {
57
-			$p =& $board[$move[1]][$move[0]];
58
-			if(($move[0] == $x && $move[1] == $y) || ($king === true && $p != null && $p->pieceID == self::KING && $this->colour != $p->colour)) {
55
+		$moves = & $this->getPossibleMoves($board, $hasMoved, null, true);
56
+		foreach ($moves as &$move) {
57
+			$p = & $board[$move[1]][$move[0]];
58
+			if (($move[0] == $x && $move[1] == $y) || ($king === true && $p != null && $p->pieceID == self::KING && $this->colour != $p->colour)) {
59 59
 				return true;
60 60
 			}
61 61
 		}
@@ -64,130 +64,130 @@  discard block
 block discarded – undo
64 64
 
65 65
 	public function &getPossibleMoves(array &$board, array &$hasMoved, $forAccountID = null, $attackingCheck = false) {
66 66
 		$moves = array();
67
-		if($forAccountID == null || $this->accountID == $forAccountID) {
68
-			if($this->pieceID==self::PAWN) {
69
-				$dirY = $this->colour==ChessGame::PLAYER_BLACK ? 1 : -1;
70
-				$moveY = $this->y+$dirY;
67
+		if ($forAccountID == null || $this->accountID == $forAccountID) {
68
+			if ($this->pieceID == self::PAWN) {
69
+				$dirY = $this->colour == ChessGame::PLAYER_BLACK ? 1 : -1;
70
+				$moveY = $this->y + $dirY;
71 71
 				//Pawn forward movement is not attacking - so don't check it if doing an attacking check.
72
-				if(!$attackingCheck) {
73
-					if(ChessGame::isValidCoord($this->x, $moveY, $board) && $board[$moveY][$this->x] == null && $this->isSafeMove($board, $hasMoved, $this->x, $moveY)) {
74
-						$moves[] = array($this->x,$moveY);
72
+				if (!$attackingCheck) {
73
+					if (ChessGame::isValidCoord($this->x, $moveY, $board) && $board[$moveY][$this->x] == null && $this->isSafeMove($board, $hasMoved, $this->x, $moveY)) {
74
+						$moves[] = array($this->x, $moveY);
75 75
 					}
76 76
 					$doubleMoveY = $moveY + $dirY;
77
-					if($this->y-$dirY == 0 || $this->y-$dirY*2 == count($board)) { //Double move first move
78
-						if($board[$moveY][$this->x] == null && $board[$doubleMoveY][$this->x] == null && $this->isSafeMove($board, $hasMoved, $this->x, $doubleMoveY)) {
79
-							$moves[] = array($this->x,$doubleMoveY);
77
+					if ($this->y - $dirY == 0 || $this->y - $dirY * 2 == count($board)) { //Double move first move
78
+						if ($board[$moveY][$this->x] == null && $board[$doubleMoveY][$this->x] == null && $this->isSafeMove($board, $hasMoved, $this->x, $doubleMoveY)) {
79
+							$moves[] = array($this->x, $doubleMoveY);
80 80
 						}
81 81
 					}
82 82
 				}
83
-				for($i=-1;$i<2;$i+=2) {
84
-					$moveX = $this->x+$i;
85
-					if(ChessGame::isValidCoord($moveX, $moveY, $board)) {
86
-						if($attackingCheck || 
83
+				for ($i = -1; $i < 2; $i += 2) {
84
+					$moveX = $this->x + $i;
85
+					if (ChessGame::isValidCoord($moveX, $moveY, $board)) {
86
+						if ($attackingCheck || 
87 87
 							((($hasMoved[ChessPiece::PAWN][0] == $moveX && $hasMoved[ChessPiece::PAWN][1] == $this->y) || 
88
-							($board[$moveY][$moveX] != null && $board[$moveY][$moveX]->colour!=$this->colour))
88
+							($board[$moveY][$moveX] != null && $board[$moveY][$moveX]->colour != $this->colour))
89 89
 							&& $this->isSafeMove($board, $hasMoved, $moveX, $moveY))) {
90
-							$moves[] = array($moveX,$moveY);
90
+							$moves[] = array($moveX, $moveY);
91 91
 						}
92 92
 					}
93 93
 				}
94 94
 			}
95
-			else if($this->pieceID==self::KING) {
96
-				for($i = -1; $i < 2; $i++) {
97
-					for($j = -1; $j < 2; $j++) {
98
-						if($i!=0 || $j!=0) {
99
-							$this->addMove($this->x+$i, $this->y+$j, $board, $moves, $hasMoved, $attackingCheck);
95
+			else if ($this->pieceID == self::KING) {
96
+				for ($i = -1; $i < 2; $i++) {
97
+					for ($j = -1; $j < 2; $j++) {
98
+						if ($i != 0 || $j != 0) {
99
+							$this->addMove($this->x + $i, $this->y + $j, $board, $moves, $hasMoved, $attackingCheck);
100 100
 						}
101 101
 					}
102 102
 				}
103 103
 				//Castling is not attacking - so don't check it if doing an attacking check.
104
-				if(!$attackingCheck && !$hasMoved[$this->colour][ChessPiece::KING] && !ChessGame::isPlayerChecked($board, $hasMoved, $this->colour)) {
105
-					if(!$hasMoved[$this->colour][ChessPiece::ROOK]['Queen'] && 
106
-							ChessGame::isValidCoord($this->x-1, $this->y, $board) && $board[$this->y][$this->x-1] == null &&
107
-							ChessGame::isValidCoord($this->x-3, $this->y, $board) && $board[$this->y][$this->x-3] == null &&
108
-							$this->isSafeMove($board, $hasMoved, $this->x-1, $this->y)) {
109
-						$this->addMove($this->x-2, $this->y, $board, $moves, $hasMoved, $attackingCheck);
104
+				if (!$attackingCheck && !$hasMoved[$this->colour][ChessPiece::KING] && !ChessGame::isPlayerChecked($board, $hasMoved, $this->colour)) {
105
+					if (!$hasMoved[$this->colour][ChessPiece::ROOK]['Queen'] && 
106
+							ChessGame::isValidCoord($this->x - 1, $this->y, $board) && $board[$this->y][$this->x - 1] == null &&
107
+							ChessGame::isValidCoord($this->x - 3, $this->y, $board) && $board[$this->y][$this->x - 3] == null &&
108
+							$this->isSafeMove($board, $hasMoved, $this->x - 1, $this->y)) {
109
+						$this->addMove($this->x - 2, $this->y, $board, $moves, $hasMoved, $attackingCheck);
110 110
 					}
111
-					if(!$hasMoved[$this->colour][ChessPiece::ROOK]['King'] &&
112
-							ChessGame::isValidCoord($this->x+1, $this->y, $board) && $board[$this->y][$this->x+1] == null &&
113
-							$this->isSafeMove($board, $hasMoved, $this->x+1, $this->y)) {
114
-						$this->addMove($this->x+2, $this->y, $board, $moves, $hasMoved, $attackingCheck);
111
+					if (!$hasMoved[$this->colour][ChessPiece::ROOK]['King'] &&
112
+							ChessGame::isValidCoord($this->x + 1, $this->y, $board) && $board[$this->y][$this->x + 1] == null &&
113
+							$this->isSafeMove($board, $hasMoved, $this->x + 1, $this->y)) {
114
+						$this->addMove($this->x + 2, $this->y, $board, $moves, $hasMoved, $attackingCheck);
115 115
 					}
116 116
 				}
117 117
 			}
118
-			else if($this->pieceID==self::QUEEN) {
118
+			else if ($this->pieceID == self::QUEEN) {
119 119
 				$moveX = $this->x;
120 120
 				$moveY = $this->y;
121
-				while($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
121
+				while ($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
122 122
 				$moveX = $this->x;
123 123
 				$moveY = $this->y;
124
-				while($this->addMove(++$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Right
124
+				while ($this->addMove(++$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Right
125 125
 				$moveX = $this->x;
126 126
 				$moveY = $this->y;
127
-				while($this->addMove($moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up
127
+				while ($this->addMove($moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up
128 128
 				$moveX = $this->x;
129 129
 				$moveY = $this->y;
130
-				while($this->addMove($moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down
130
+				while ($this->addMove($moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down
131 131
 				$moveX = $this->x;
132 132
 				$moveY = $this->y;
133
-				while($this->addMove(--$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
133
+				while ($this->addMove(--$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
134 134
 				$moveX = $this->x;
135 135
 				$moveY = $this->y;
136
-				while($this->addMove(++$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Right
136
+				while ($this->addMove(++$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Right
137 137
 				$moveX = $this->x;
138 138
 				$moveY = $this->y;
139
-				while($this->addMove(--$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down-Left
139
+				while ($this->addMove(--$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down-Left
140 140
 				$moveX = $this->x;
141 141
 				$moveY = $this->y;
142
-				while($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
142
+				while ($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
143 143
 			}
144
-			else if($this->pieceID==self::ROOK) {
144
+			else if ($this->pieceID == self::ROOK) {
145 145
 				$moveX = $this->x;
146 146
 				$moveY = $this->y;
147
-				while($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
147
+				while ($this->addMove(--$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Left
148 148
 				$moveX = $this->x;
149 149
 				$moveY = $this->y;
150
-				while($this->addMove(++$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Right
150
+				while ($this->addMove(++$moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Right
151 151
 				$moveX = $this->x;
152 152
 				$moveY = $this->y;
153
-				while($this->addMove($moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up
153
+				while ($this->addMove($moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up
154 154
 				$moveX = $this->x;
155 155
 				$moveY = $this->y;
156
-				while($this->addMove($moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down
156
+				while ($this->addMove($moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down
157 157
 			}
158
-			else if($this->pieceID==self::BISHOP) {
158
+			else if ($this->pieceID == self::BISHOP) {
159 159
 				$moveX = $this->x;
160 160
 				$moveY = $this->y;
161
-				while($this->addMove(--$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
161
+				while ($this->addMove(--$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
162 162
 				$moveX = $this->x;
163 163
 				$moveY = $this->y;
164
-				while($this->addMove(++$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Right
164
+				while ($this->addMove(++$moveX, --$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Right
165 165
 				$moveX = $this->x;
166 166
 				$moveY = $this->y;
167
-				while($this->addMove(--$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down-Left
167
+				while ($this->addMove(--$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Down-Left
168 168
 				$moveX = $this->x;
169 169
 				$moveY = $this->y;
170
-				while($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
170
+				while ($this->addMove(++$moveX, ++$moveY, $board, $moves, $hasMoved, $attackingCheck) && $board[$moveY][$moveX] == null); //Up-Left
171 171
 			}
172
-			else if($this->pieceID==self::KNIGHT) {
173
-				$moveX = $this->x-1;
174
-				$moveY = $this->y-2;
175
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2up-left
172
+			else if ($this->pieceID == self::KNIGHT) {
173
+				$moveX = $this->x - 1;
174
+				$moveY = $this->y - 2;
175
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2up-left
176 176
 				$moveX += 2;
177
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2up-right
178
-				$moveY = $this->y+2;
179
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2down-right
177
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2up-right
178
+				$moveY = $this->y + 2;
179
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2down-right
180 180
 				$moveX -= 2;
181
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2down-left
182
-				$moveX = $this->x-2;
183
-				$moveY = $this->y-1;
184
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2left-up
181
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2down-left
182
+				$moveX = $this->x - 2;
183
+				$moveY = $this->y - 1;
184
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2left-up
185 185
 				$moveY += 2;
186
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2left-down
187
-				$moveX = $this->x+2;
188
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2right-down
186
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2left-down
187
+				$moveX = $this->x + 2;
188
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2right-down
189 189
 				$moveY -= 2;
190
-				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck);//2right-up
190
+				$this->addMove($moveX, $moveY, $board, $moves, $hasMoved, $attackingCheck); //2right-up
191 191
 			}
192 192
 		}
193 193
 		
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 	}
196 196
 	
197 197
 	private function addMove($toX, $toY, array &$board, array &$moves, array &$hasMoved = null, $attackingCheck = true) {
198
-		if(ChessGame::isValidCoord($toX, $toY, $board)) {
199
-			if(($board[$toY][$toX] == null || $board[$toY][$toX]->colour!=$this->colour)) {
198
+		if (ChessGame::isValidCoord($toX, $toY, $board)) {
199
+			if (($board[$toY][$toX] == null || $board[$toY][$toX]->colour != $this->colour)) {
200 200
 				//We can only actually move to this position if it is safe to do so, however we can pass through it looking for a safe move so we still want to return true.
201
-				if(($attackingCheck == true || $this->isSafeMove($board, $hasMoved, $toX, $toY))) {
202
-					$moves[] = array($toX,$toY);
201
+				if (($attackingCheck == true || $this->isSafeMove($board, $hasMoved, $toX, $toY))) {
202
+					$moves[] = array($toX, $toY);
203 203
 				}
204 204
 				return true;
205 205
 			}
@@ -208,30 +208,30 @@  discard block
 block discarded – undo
208 208
 	}
209 209
 	
210 210
 	public function promote($pawnPromotionPieceID, array &$board) {
211
-		if($pawnPromotionPieceID==null) {
211
+		if ($pawnPromotionPieceID == null) {
212 212
 			throw new Exception('Promotion piece cannot be null on a promote.');
213 213
 		}
214 214
 		$takenNos = array();
215
-		foreach($board as $row) {
216
-			foreach($row as $piece) {
217
-				if($piece != null && $piece->pieceID == $pawnPromotionPieceID && $piece->colour == $this->colour) {
215
+		foreach ($board as $row) {
216
+			foreach ($row as $piece) {
217
+				if ($piece != null && $piece->pieceID == $pawnPromotionPieceID && $piece->colour == $this->colour) {
218 218
 					$takenNos[$piece->pieceNo] = true;
219 219
 				}
220 220
 			}
221 221
 		}
222
-		$i=0;
223
-		while(isset($takenNos[$i])) {
222
+		$i = 0;
223
+		while (isset($takenNos[$i])) {
224 224
 			$i++;
225 225
 		}
226 226
 		return array('PieceID' => $pawnPromotionPieceID, 'PieceNo' => $i);
227 227
 	}
228 228
 
229 229
 	public function getPieceLetter() {
230
-		return self::getLetterForPiece($this->pieceID,$this->colour);
230
+		return self::getLetterForPiece($this->pieceID, $this->colour);
231 231
 	}
232 232
 
233 233
 	public function getPieceSymbol() {
234
-		return self::getSymbolForPiece($this->pieceID,$this->colour);
234
+		return self::getSymbolForPiece($this->pieceID, $this->colour);
235 235
 	}
236 236
 
237 237
 	public static function getSymbolForPiece($pieceID, $colour) {
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 	}
240 240
 
241 241
 	public static function getLetterForPiece($pieceID, $colour) {
242
-		switch($pieceID) {
242
+		switch ($pieceID) {
243 243
 			case self::KING:
244 244
 				$letter = 'k';
245 245
 			break;
@@ -260,14 +260,14 @@  discard block
 block discarded – undo
260 260
 				$letter = 'p';
261 261
 			break;
262 262
 		}
263
-		if($colour == ChessGame::PLAYER_WHITE) {
263
+		if ($colour == ChessGame::PLAYER_WHITE) {
264 264
 			$letter = strtoupper($letter);
265 265
 		}
266 266
 		return $letter;
267 267
 	}
268 268
 
269 269
 	public static function getPieceForLetter($letter) {
270
-		switch($letter) {
270
+		switch ($letter) {
271 271
 			case 'k':
272 272
 			case 'K':
273 273
 				return self::KING;
Please login to merge, or discard this 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 2 patches
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.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 		$this->cargo_left = $this->getCargoHolds();
18 18
 	}
19 19
 	protected function doFullUNO() {
20
-		foreach($this->getMaxHardware() as $hardwareTypeID => $max) {
20
+		foreach ($this->getMaxHardware() as $hardwareTypeID => $max) {
21 21
 			$this->hardware[$hardwareTypeID] = $max;
22 22
 			$this->oldHardware[$hardwareTypeID] = $max;
23 23
 		}
@@ -47,8 +47,8 @@  discard block
 block discarded – undo
47 47
 	}
48 48
 	
49 49
 	public function getIllusionShip() {
50
-		if(!isset($this->illusionShip)) {
51
-			$this->illusionShip=false;
50
+		if (!isset($this->illusionShip)) {
51
+			$this->illusionShip = false;
52 52
 		}
53 53
 		return $this->illusionShip;
54 54
 	}
@@ -58,20 +58,20 @@  discard block
 block discarded – undo
58 58
 		$db = new SmrMySqlDatabase();
59 59
 		$db->query('REPLACE INTO cached_dummys ' .
60 60
 					'(type, id, info) ' .
61
-					'VALUES (\'DummyShip\', '.$db->escapeString($this->getPlayer()->getPlayerName()).', '.$db->escapeString($cache).')');
61
+					'VALUES (\'DummyShip\', ' . $db->escapeString($this->getPlayer()->getPlayerName()) . ', ' . $db->escapeString($cache) . ')');
62 62
 		unserialize($cache);
63 63
 	}
64 64
 	
65 65
 	public static function getCachedDummyShip(AbstractSmrPlayer $player) {
66
-		if(!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
66
+		if (!isset(self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()])) {
67 67
 			$db = new SmrMySqlDatabase();
68 68
 			$db->query('SELECT info FROM cached_dummys
69 69
 						WHERE type = \'DummyShip\'
70 70
 						AND id = ' . $db->escapeString($player->getPlayerName()) . ' LIMIT 1');
71
-			if($db->nextRecord()) {
71
+			if ($db->nextRecord()) {
72 72
 				$return = unserialize($db->getField('info'));
73 73
 				$return->regenerate($player);
74
-				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] =& $return;
74
+				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = & $return;
75 75
 			}
76 76
 			else {
77 77
 				self::$CACHED_DUMMY_SHIPS[$player->getPlayerName()] = new DummyShip($player);
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
 		$db->query('SELECT id FROM cached_dummys
86 86
 					WHERE type = \'DummyShip\'');
87 87
 		$dummyNames = array();
88
-		while($db->nextRecord()) {
88
+		while ($db->nextRecord()) {
89 89
 			$dummyNames[] = $db->getField('id');
90 90
 		}
91 91
 		return $dummyNames;
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	
95 95
 	
96 96
 	public function __sleep() {
97
-		return array('gameID','weapons');
97
+		return array('gameID', 'weapons');
98 98
 	}
99 99
 	
100 100
 	public function __wakeup() {
Please login to merge, or discard this patch.
lib/Default/SmrSector.class.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -549,7 +549,7 @@
 block discarded – undo
549 549
 	 */
550 550
 	public function setWarp(SmrSector $warp) {
551 551
 		if ($this->getWarp() == $warp->getSectorID() &&
552
-		    $warp->getWarp() == $this->getSectorID()) {
552
+			$warp->getWarp() == $this->getSectorID()) {
553 553
 			// Warps are already set correctly!
554 554
 			return;
555 555
 		}
Please login to merge, or discard this patch.
lib/Default/SmrForce.class.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -446,20 +446,20 @@
 block discarded – undo
446 446
 
447 447
 		if ($this->hasMines()) {
448 448
 			$thisMines = new SmrMines($this->getGameID(), $this->getMines());
449
-			$results['Results']['Mines'] =& $thisMines->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)], $minesAreAttacker);
449
+			$results['Results']['Mines'] = & $thisMines->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)], $minesAreAttacker);
450 450
 			$results['TotalDamage'] += $results['Results']['Mines']['ActualDamage']['TotalDamage'];
451 451
 		}
452 452
 
453 453
 		if ($this->hasCDs()) {
454 454
 			$thisCDs = new SmrCombatDrones($this->getGameID(), $this->getCDs());
455
-			$results['Results']['Drones'] =& $thisCDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]);
455
+			$results['Results']['Drones'] = & $thisCDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]);
456 456
 			$results['TotalDamage'] += $results['Results']['Drones']['ActualDamage']['TotalDamage'];
457 457
 		}
458 458
 
459 459
 		if (!$minesAreAttacker) {
460 460
 			if ($this->hasSDs()) {
461 461
 				$thisSDs = new SmrScoutDrones($this->getGameID(), $this->getSDs());
462
-				$results['Results']['Scouts'] =& $thisSDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]);
462
+				$results['Results']['Scouts'] = & $thisSDs->shootPlayerAsForce($this, $targetPlayers[array_rand($targetPlayers)]);
463 463
 				$results['TotalDamage'] += $results['Results']['Scouts']['ActualDamage']['TotalDamage'];
464 464
 			}
465 465
 		}
Please login to merge, or discard this patch.
lib/Default/Menu.class.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -100,16 +100,16 @@
 block discarded – undo
100 100
 		$container['view_game_id'] = $var['view_game_id'];
101 101
 		$container['game_name'] = $var['game_name'];
102 102
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
103
-		                'Text' => 'Game Details'];
103
+						'Text' => 'Game Details'];
104 104
 		$container['body'] = 'history_games_detail.php';
105 105
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
106
-		                'Text' => 'Extended Stats'];
106
+						'Text' => 'Extended Stats'];
107 107
 		$container['body'] = 'history_games_hof.php';
108 108
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
109
-		                'Text' => 'Hall of Fame'];
109
+						'Text' => 'Hall of Fame'];
110 110
 		$container['body'] = 'history_games_news.php';
111 111
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
112
-		                'Text' => 'Game News'];
112
+						'Text' => 'Game News'];
113 113
 		// make the selected index bold
114 114
 		$boldItem =& $menuItems[$selected_index]['Text'];
115 115
 		$boldItem = '<b>' . $boldItem . '</b>';
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 		$menuItems[] = array('Link'=>Globals::getPlanetListHREF($alliance_id), 'Text'=>'Defense');
13 13
 		$menuItems[] = array('Link'=>Globals::getPlanetListFinancialHREF($alliance_id), 'Text'=>'Financial');
14 14
 		// make the selected index bold
15
-		$boldItem =& $menuItems[$selected_index]['Text'];
15
+		$boldItem = & $menuItems[$selected_index]['Text'];
16 16
 		$boldItem = '<span class="bold">' . $boldItem . '</span>';
17 17
 		$template->assign('MenuItems', $menuItems);
18 18
 	}
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
 		$menuItems[] = ['Link' => SmrSession::getNewHREF($container),
108 108
 		                'Text' => 'Game News'];
109 109
 		// make the selected index bold
110
-		$boldItem =& $menuItems[$selected_index]['Text'];
110
+		$boldItem = & $menuItems[$selected_index]['Text'];
111 111
 		$boldItem = '<b>' . $boldItem . '</b>';
112 112
 		$template->assign('MenuItems', $menuItems);
113 113
 	}
Please login to merge, or discard this patch.
lib/Default/SmrPlanetType.class.php 1 patch
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	/**
41 41
 	 * Access properties of structures that this planet type can build.
42 42
 	 */
43
-	public function structureTypes($structureID=false) {
43
+	public function structureTypes($structureID = false) {
44 44
 		if (!isset($this->structures)) {
45 45
 			foreach (static::STRUCTURES as $ID => $Info) {
46 46
 				$this->structures[$ID] = new SmrPlanetStructureType($ID, $Info);
@@ -77,12 +77,12 @@  discard block
 block discarded – undo
77 77
 			'exp_gain' => 540,
78 78
 		],
79 79
 	];
80
-	public function name()         { return "Terran Planet"; }
81
-	public function imageLink()    { return "images/planet1.png"; }
82
-	public function description()  { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; }
80
+	public function name() { return "Terran Planet"; }
81
+	public function imageLink() { return "images/planet1.png"; }
82
+	public function description() { return "A lush world, with forests, seas, sweeping meadows, and indigenous lifeforms."; }
83 83
 	public function maxAttackers() { return 10; }
84
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
85
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
84
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
85
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
86 86
 }
87 87
 
88 88
 class AridPlanet extends SmrPlanetType {
@@ -106,12 +106,12 @@  discard block
 block discarded – undo
106 106
 			'exp_gain' => 180,
107 107
 		],
108 108
 	];
109
-	public function name()         { return "Arid Planet"; }
110
-	public function imageLink()    { return "images/planet2.png"; }
111
-	public function description()  { return "A world mostly devoid of surface water, but capable of supporting life."; }
109
+	public function name() { return "Arid Planet"; }
110
+	public function imageLink() { return "images/planet2.png"; }
111
+	public function description() { return "A world mostly devoid of surface water, but capable of supporting life."; }
112 112
 	public function maxAttackers() { return 5; }
113
-	public function maxLanded()    { return 5; }
114
-	public function menuOptions()  { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; }
113
+	public function maxLanded() { return 5; }
114
+	public function menuOptions() { return ['CONSTRUCTION', 'DEFENSE', 'STOCKPILE', 'OWNERSHIP']; }
115 115
 }
116 116
 
117 117
 class DwarfPlanet extends SmrPlanetType {
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
 			'exp_gain' => 540,
136 136
 		],
137 137
 	];
138
-	public function name()         { return "Dwarf Planet"; }
139
-	public function imageLink()    { return "images/planet3.png"; }
140
-	public function description()  { return "A smaller than usual planet, with no native life present."; }
138
+	public function name() { return "Dwarf Planet"; }
139
+	public function imageLink() { return "images/planet3.png"; }
140
+	public function description() { return "A smaller than usual planet, with no native life present."; }
141 141
 	public function maxAttackers() { return 5; }
142
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
143
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
142
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
143
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
144 144
 }
145 145
 
146 146
 class ProtoPlanet extends SmrPlanetType {
@@ -170,12 +170,12 @@  discard block
 block discarded – undo
170 170
 			'exp_gain' => 540,
171 171
 		],
172 172
 	];
173
-	public function name()         { return "Protoplanet"; }
174
-	public function imageLink()    { return "images/planet5.png"; }
175
-	public function description()  { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; }
173
+	public function name() { return "Protoplanet"; }
174
+	public function imageLink() { return "images/planet5.png"; }
175
+	public function description() { return "A developing planet, not yet able to support the infrastructure of advanced technologies."; }
176 176
 	public function maxAttackers() { return 5; }
177
-	public function maxLanded()    { return 5; }
178
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
177
+	public function maxLanded() { return 5; }
178
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
179 179
 }
180 180
 
181 181
 class DefenseWorld extends SmrPlanetType {
@@ -205,10 +205,10 @@  discard block
 block discarded – undo
205 205
 			'exp_gain' => 9,
206 206
 		],
207 207
 	];
208
-	public function name()         { return "Defense World"; }
209
-	public function imageLink()    { return "images/planet4.png"; }
210
-	public function description()  { return "A fully armed and operational battle station loaded with excessive firepower."; }
208
+	public function name() { return "Defense World"; }
209
+	public function imageLink() { return "images/planet4.png"; }
210
+	public function description() { return "A fully armed and operational battle station loaded with excessive firepower."; }
211 211
 	public function maxAttackers() { return 10; }
212
-	public function maxLanded()    { return self::MAX_LANDED_UNLIMITED; }
213
-	public function menuOptions()  { return self::DEFAULT_MENU_OPTIONS; }
212
+	public function maxLanded() { return self::MAX_LANDED_UNLIMITED; }
213
+	public function menuOptions() { return self::DEFAULT_MENU_OPTIONS; }
214 214
 }
Please login to merge, or discard this patch.