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

Completed
Push — master ( 8d8584...432c27 )
by Dan
31s queued 20s
created
engine/Default/hall_of_fame_player_detail.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,13 +20,13 @@
 block discarded – undo
20 20
 const USER_SCORE_NAME = 'User Score';
21 21
 $hofTypes = array(DONATION_NAME=>true, USER_SCORE_NAME=>true);
22 22
 while ($db->nextRecord()) {
23
-	$hof =& $hofTypes;
23
+	$hof = & $hofTypes;
24 24
 	$typeList = explode(':', $db->getField('type'));
25 25
 	foreach ($typeList as $type) {
26 26
 		if (!isset($hof[$type])) {
27 27
 			$hof[$type] = array();
28 28
 		}
29
-		$hof =& $hof[$type];
29
+		$hof = & $hof[$type];
30 30
 	}
31 31
 	$hof = true;
32 32
 }
Please login to merge, or discard this patch.
htdocs/weapon_list.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	$weapons = [];
12 12
 	$db->query('SELECT * FROM weapon_type JOIN race USING(race_id)');
13 13
 	while ($db->nextRecord()) {
14
-		switch($db->getInt('buyer_restriction')) {
14
+		switch ($db->getInt('buyer_restriction')) {
15 15
 			case BUYER_RESTRICTION_GOOD:
16 16
 				$restriction = '<span class="dgreen">Good</span>';
17 17
 			break;
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 
47 47
 	$template->display('weapon_list.php');
48 48
 }
49
-catch(Throwable $e) {
49
+catch (Throwable $e) {
50 50
 	handleException($e);
51 51
 }
52 52
 
53 53
 function buildSelector($db, $name, $table) {
54 54
 	$selector = '<select onchange="filterSelect(this)"><option>All</option>';
55
-	$db->query("SELECT DISTINCT ".$name." FROM ".$table." ORDER BY ".$name);
55
+	$db->query("SELECT DISTINCT " . $name . " FROM " . $table . " ORDER BY " . $name);
56 56
 	while ($db->nextRecord()) {
57
-		$selector .= '<option>'.$db->getField($name).'</option>';
57
+		$selector .= '<option>' . $db->getField($name) . '</option>';
58 58
 	}
59 59
 	$selector .= '</select>';
60 60
 	return $selector;
@@ -66,8 +66,8 @@  discard block
 block discarded – undo
66 66
 	foreach (Globals::getRaces() as $raceID => $raceData) {
67 67
 		$raceName = $raceData['Race Name'];
68 68
 		$racebox .= '
69
-			<input type="checkbox" id="race'.$raceID.'" name="races" value="'.$raceName.'" onClick="raceToggle()">
70
-			<label for="race'.$raceID.'" class="race'.$raceID.'">'.$raceName.'</label>&thinsp;';
69
+			<input type="checkbox" id="race'.$raceID . '" name="races" value="' . $raceName . '" onClick="raceToggle()">
70
+			<label for="race'.$raceID . '" class="race' . $raceID . '">' . $raceName . '</label>&thinsp;';
71 71
 	}
72 72
 	$racebox .= '</form>';
73 73
 	return $racebox;
Please login to merge, or discard this patch.
htdocs/ship_list.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 	$template->display('ship_list.php');
19 19
 }
20
-catch(Throwable $e) {
20
+catch (Throwable $e) {
21 21
 	handleException($e);
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	$selector = '<select onchange="filterSelect(this)"><option>All</option>';
26 26
 	$db->query('SELECT DISTINCT ' . $name . ' FROM ' . $table . ' ORDER BY ' . $name);
27 27
 	while ($db->nextRecord()) {
28
-		$selector .= '<option>'.$db->getField($name).'</option>';
28
+		$selector .= '<option>' . $db->getField($name) . '</option>';
29 29
 	}
30 30
 	$selector .= '</select>';
31 31
 	return $selector;
Please login to merge, or discard this patch.
lib/Default/AbstractSmrPlayer.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -896,8 +896,8 @@  discard block
 block discarded – undo
896 896
 		}
897 897
 		self::$HOFVis[$hofType] = $visibility;
898 898
 
899
-		$hof =& $this->HOF;
900
-		$hofChanged =& $this->hasHOFChanged;
899
+		$hof = & $this->HOF;
900
+		$hofChanged = & $this->hasHOFChanged;
901 901
 		$new = false;
902 902
 		foreach ($typeList as $type) {
903 903
 			if (!isset($hofChanged[$type]))
@@ -906,8 +906,8 @@  discard block
 block discarded – undo
906 906
 				$hof[$type] = array();
907 907
 				$new = true;
908 908
 			}
909
-			$hof =& $hof[$type];
910
-			$hofChanged =& $hofChanged[$type];
909
+			$hof = & $hof[$type];
910
+			$hofChanged = & $hofChanged[$type];
911 911
 		}
912 912
 		if ($hofChanged == null) {
913 913
 			$hofChanged = self::HOF_CHANGED;
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
 	}
1060 1060
 
1061 1061
 	private function setupMissionStep($missionID) {
1062
-		$mission =& $this->missions[$missionID];
1062
+		$mission = & $this->missions[$missionID];
1063 1063
 		if ($mission['On Step'] >= count(MISSIONS[$missionID]['Steps'])) {
1064 1064
 			// Nothing to do if this mission is already completed
1065 1065
 			return;
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 			'Starting Sector' => $this->getSectorID()
1104 1104
 		);
1105 1105
 
1106
-		$this->missions[$missionID] =& $mission;
1106
+		$this->missions[$missionID] = & $mission;
1107 1107
 		$this->setupMissionStep($missionID);
1108 1108
 		$this->rebuildMission($missionID);
1109 1109
 
@@ -1162,7 +1162,7 @@  discard block
 block discarded – undo
1162 1162
 
1163 1163
 	public function claimMissionReward($missionID) {
1164 1164
 		$this->getMissions();
1165
-		$mission =& $this->missions[$missionID];
1165
+		$mission = & $this->missions[$missionID];
1166 1166
 		if ($mission === false) {
1167 1167
 			throw new Exception('Unknown mission: ' . $missionID);
1168 1168
 		}
Please login to merge, or discard this patch.
lib/Default/ChessPiece.class.php 1 patch
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.
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/AbstractSmrCombatWeapon.class.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	protected $maxDamage;
13 13
 	protected $shieldDamage;
14 14
 	protected $armourDamage;
15
-	protected $empDamage=0;
15
+	protected $empDamage = 0;
16 16
 	protected $accuracy;
17 17
 	protected $damageRollover;
18 18
 	protected $raidWeapon;
@@ -85,62 +85,62 @@  discard block
 block discarded – undo
85 85
 	abstract public function &getModifiedForceDamageAgainstPlayer(SmrForce $forces, AbstractSmrPlayer $targetPlayer);
86 86
 	
87 87
 	protected function &doPlayerDamageToForce(array &$return, AbstractSmrPlayer $weaponPlayer, SmrForce $forces) {
88
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstForces($weaponPlayer,$forces);
89
-		$return['ActualDamage'] =& $forces->doWeaponDamage($return['WeaponDamage']);
90
-		if($return['ActualDamage']['KillingShot'])
91
-			$return['KillResults'] =& $forces->killForcesByPlayer($weaponPlayer);
88
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstForces($weaponPlayer, $forces);
89
+		$return['ActualDamage'] = & $forces->doWeaponDamage($return['WeaponDamage']);
90
+		if ($return['ActualDamage']['KillingShot'])
91
+			$return['KillResults'] = & $forces->killForcesByPlayer($weaponPlayer);
92 92
 		return $return;
93 93
 	}
94 94
 	
95 95
 	protected function &doPlayerDamageToPlayer(array &$return, AbstractSmrPlayer $weaponPlayer, AbstractSmrPlayer $targetPlayer) {
96
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlayer($weaponPlayer,$targetPlayer);
97
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
96
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlayer($weaponPlayer, $targetPlayer);
97
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
98 98
 
99
-		if($return['ActualDamage']['KillingShot'])
100
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlayer($weaponPlayer);
99
+		if ($return['ActualDamage']['KillingShot'])
100
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlayer($weaponPlayer);
101 101
 		return $return;
102 102
 	}
103 103
 	
104 104
 	protected function &doPlayerDamageToPort(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPort $port) {
105
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPort($weaponPlayer,$port);
106
-		$return['ActualDamage'] =& $port->doWeaponDamage($return['WeaponDamage']);
107
-		if($return['ActualDamage']['KillingShot'])
108
-			$return['KillResults'] =& $port->killPortByPlayer($weaponPlayer);
105
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPort($weaponPlayer, $port);
106
+		$return['ActualDamage'] = & $port->doWeaponDamage($return['WeaponDamage']);
107
+		if ($return['ActualDamage']['KillingShot'])
108
+			$return['KillResults'] = & $port->killPortByPlayer($weaponPlayer);
109 109
 		return $return;
110 110
 	}
111 111
 	
112 112
 	protected function &doPlayerDamageToPlanet(array &$return, AbstractSmrPlayer $weaponPlayer, SmrPlanet $planet, $delayed) {
113
-		$return['WeaponDamage'] =& $this->getModifiedDamageAgainstPlanet($weaponPlayer,$planet);
114
-		$return['ActualDamage'] =& $planet->doWeaponDamage($return['WeaponDamage'],$delayed);
115
-		if($return['ActualDamage']['KillingShot'])
116
-			$return['KillResults'] =& $planet->killPlanetByPlayer($weaponPlayer);
113
+		$return['WeaponDamage'] = & $this->getModifiedDamageAgainstPlanet($weaponPlayer, $planet);
114
+		$return['ActualDamage'] = & $planet->doWeaponDamage($return['WeaponDamage'], $delayed);
115
+		if ($return['ActualDamage']['KillingShot'])
116
+			$return['KillResults'] = & $planet->killPlanetByPlayer($weaponPlayer);
117 117
 		return $return;
118 118
 	}
119 119
 	
120 120
 	protected function &doPortDamageToPlayer(array &$return, SmrPort $port, AbstractSmrPlayer $targetPlayer) {
121
-		$return['WeaponDamage'] =& $this->getModifiedPortDamageAgainstPlayer($port,$targetPlayer);
122
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
121
+		$return['WeaponDamage'] = & $this->getModifiedPortDamageAgainstPlayer($port, $targetPlayer);
122
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
123 123
 
124
-		if($return['ActualDamage']['KillingShot'])
125
-			$return['KillResults'] =& $targetPlayer->killPlayerByPort($port);
124
+		if ($return['ActualDamage']['KillingShot'])
125
+			$return['KillResults'] = & $targetPlayer->killPlayerByPort($port);
126 126
 		return $return;
127 127
 	}
128 128
 	
129 129
 	protected function &doPlanetDamageToPlayer(array &$return, SmrPlanet $planet, AbstractSmrPlayer $targetPlayer) {
130
-		$return['WeaponDamage'] =& $this->getModifiedPlanetDamageAgainstPlayer($planet,$targetPlayer);
131
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
130
+		$return['WeaponDamage'] = & $this->getModifiedPlanetDamageAgainstPlayer($planet, $targetPlayer);
131
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
132 132
 
133
-		if($return['ActualDamage']['KillingShot'])
134
-			$return['KillResults'] =& $targetPlayer->killPlayerByPlanet($planet);
133
+		if ($return['ActualDamage']['KillingShot'])
134
+			$return['KillResults'] = & $targetPlayer->killPlayerByPlanet($planet);
135 135
 		return $return;
136 136
 	}
137 137
 	
138 138
 	protected function &doForceDamageToPlayer(array &$return, SmrForce $forces, AbstractSmrPlayer $targetPlayer) {
139
-		$return['WeaponDamage'] =& $this->getModifiedForceDamageAgainstPlayer($forces,$targetPlayer);
140
-		$return['ActualDamage'] =& $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
139
+		$return['WeaponDamage'] = & $this->getModifiedForceDamageAgainstPlayer($forces, $targetPlayer);
140
+		$return['ActualDamage'] = & $targetPlayer->getShip()->doWeaponDamage($return['WeaponDamage']);
141 141
 
142
-		if($return['ActualDamage']['KillingShot'])
143
-			$return['KillResults'] =& $targetPlayer->killPlayerByForces($forces);
142
+		if ($return['ActualDamage']['KillingShot'])
143
+			$return['KillResults'] = & $targetPlayer->killPlayerByForces($forces);
144 144
 		return $return;
145 145
 	}
146 146
 	
Please login to merge, or discard this patch.
lib/Default/Menu.class.php 1 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.