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
Branch master (287493)
by Dan
06:08
created
engine/Default/shop_goods_processing.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
 $portGood = $port->getGood($good_id);
33 33
 // check if there are enough left at port
34 34
 if ($port->getGoodAmount($good_id) < $amount)
35
-	create_error('I\'m short of '.$good_name.'. So I\'m not going to sell you '.$amount.' pcs.');
35
+	create_error('I\'m short of ' . $good_name . '. So I\'m not going to sell you ' . $amount . ' pcs.');
36 36
 
37 37
 // does we have what we are going to sell?
38 38
 if ($transaction == 'Sell' && $amount > $ship->getCargo($good_id))
39
-	create_error('Scanning your ships indicates you don\'t have '.$amount.' pcs. of '.$good_name.'!');
39
+	create_error('Scanning your ships indicates you don\'t have ' . $amount . ' pcs. of ' . $good_name . '!');
40 40
 
41 41
 // check if we have enough room for the thing we are going to buy
42 42
 if ($transaction == 'Buy' && $amount > $ship->getEmptyHolds())
@@ -49,10 +49,10 @@  discard block
 block discarded – undo
49 49
 // get relations for us (global + personal)
50 50
 $relations = $player->getRelation($port->getRaceID());
51 51
 
52
-if (!isset($var['ideal_price'])) SmrSession::updateVar('ideal_price',$port->getIdealPrice($good_id, $transaction, $amount, $relations));
52
+if (!isset($var['ideal_price'])) SmrSession::updateVar('ideal_price', $port->getIdealPrice($good_id, $transaction, $amount, $relations));
53 53
 $ideal_price = $var['ideal_price'];
54 54
 
55
-if (!isset($var['offered_price'])) SmrSession::updateVar('offered_price',$port->getOfferPrice($ideal_price, $relations, $transaction));
55
+if (!isset($var['offered_price'])) SmrSession::updateVar('offered_price', $port->getOfferPrice($ideal_price, $relations, $transaction));
56 56
 $offered_price = $var['offered_price'];
57 57
 
58 58
 // nothing should happen here but just to avoid / by 0
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 		$player->setCredits($newCredits);
75 75
 		$player->decreaseAlignment(5);
76 76
 
77
-		$fineMessage = '<span class="red">A Federation patrol caught you loading stolen goods onto your ship!<br />The stolen goods have been confiscated and you have been fined '.number_format($fine).' credits.</span><br /><br />';
77
+		$fineMessage = '<span class="red">A Federation patrol caught you loading stolen goods onto your ship!<br />The stolen goods have been confiscated and you have been fined ' . number_format($fine) . ' credits.</span><br /><br />';
78 78
 		$container = create_container('skeleton.php', 'shop_goods.php');
79 79
 		$container['trade_msg'] = $fineMessage;
80 80
 		forward($container);
@@ -97,60 +97,60 @@  discard block
 block discarded – undo
97 97
 	$base_xp = SmrPort::getBaseExperience($amount, $port->getGoodDistance($good_id));
98 98
 
99 99
 	// if offered equals ideal we get a problem (division by zero)
100
-	$gained_exp = round($port->calculateExperiencePercent($ideal_price,$offered_price,$bargain_price,$transaction) * $base_xp);
100
+	$gained_exp = round($port->calculateExperiencePercent($ideal_price, $offered_price, $bargain_price, $transaction) * $base_xp);
101 101
 
102 102
 	if ($transaction == 'Buy') {
103 103
 		$msg_transaction = 'bought';
104
-		$ship->increaseCargo($good_id,$amount);
104
+		$ship->increaseCargo($good_id, $amount);
105 105
 		$player->decreaseCredits($bargain_price);
106
-		$player->increaseHOF($amount,array('Trade','Goods','Bought'), HOF_ALLIANCE);
107
-		$player->increaseHOF($gained_exp,array('Trade','Experience','Buying'), HOF_PUBLIC);
108
-		$player->decreaseHOF($bargain_price,array('Trade','Money','Profit'), HOF_PUBLIC);
109
-		$player->increaseHOF($bargain_price,array('Trade','Money','Buying'), HOF_PUBLIC);
110
-		$port->buyGoods($portGood,$amount,$ideal_price,$bargain_price,$gained_exp);
106
+		$player->increaseHOF($amount, array('Trade', 'Goods', 'Bought'), HOF_ALLIANCE);
107
+		$player->increaseHOF($gained_exp, array('Trade', 'Experience', 'Buying'), HOF_PUBLIC);
108
+		$player->decreaseHOF($bargain_price, array('Trade', 'Money', 'Profit'), HOF_PUBLIC);
109
+		$player->increaseHOF($bargain_price, array('Trade', 'Money', 'Buying'), HOF_PUBLIC);
110
+		$port->buyGoods($portGood, $amount, $ideal_price, $bargain_price, $gained_exp);
111 111
 	}
112 112
 	elseif ($transaction == 'Sell') {
113 113
 		$msg_transaction = 'sold';
114
-		$ship->decreaseCargo($good_id,$amount);
114
+		$ship->decreaseCargo($good_id, $amount);
115 115
 		$player->increaseCredits($bargain_price);
116
-		$player->increaseHOF($amount,array('Trade','Goods','Sold'), HOF_ALLIANCE);
117
-		$player->increaseHOF($gained_exp,array('Trade','Experience','Selling'), HOF_PUBLIC);
118
-		$player->increaseHOF($bargain_price,array('Trade','Money','Profit'), HOF_PUBLIC);
119
-		$player->increaseHOF($bargain_price,array('Trade','Money','Selling'), HOF_PUBLIC);
120
-		$port->sellGoods($portGood,$amount,$ideal_price,$bargain_price,$gained_exp);
116
+		$player->increaseHOF($amount, array('Trade', 'Goods', 'Sold'), HOF_ALLIANCE);
117
+		$player->increaseHOF($gained_exp, array('Trade', 'Experience', 'Selling'), HOF_PUBLIC);
118
+		$player->increaseHOF($bargain_price, array('Trade', 'Money', 'Profit'), HOF_PUBLIC);
119
+		$player->increaseHOF($bargain_price, array('Trade', 'Money', 'Selling'), HOF_PUBLIC);
120
+		$port->sellGoods($portGood, $amount, $ideal_price, $bargain_price, $gained_exp);
121 121
 	}
122 122
 	elseif ($transaction == 'Steal') {
123 123
 		$msg_transaction = 'stolen';
124 124
 		$bargain_price = 0;
125 125
 		$gained_exp = round($base_xp);
126
-		$ship->increaseCargo($good_id,$amount);
127
-		$player->increaseHOF($amount, array('Trade','Goods','Stolen'), HOF_ALLIANCE);
128
-		$player->increaseHOF($gained_exp, array('Trade','Experience','Stealing'), HOF_PUBLIC);
126
+		$ship->increaseCargo($good_id, $amount);
127
+		$player->increaseHOF($amount, array('Trade', 'Goods', 'Stolen'), HOF_ALLIANCE);
128
+		$player->increaseHOF($gained_exp, array('Trade', 'Experience', 'Stealing'), HOF_PUBLIC);
129 129
 		$port->buyGoods($portGood, $amount, $ideal_price, $bargain_price, $gained_exp);
130 130
 	}
131 131
 
132
-	$player->increaseHOF($gained_exp,array('Trade','Experience','Total'), HOF_PUBLIC);
133
-	$player->increaseHOF(1,array('Trade','Results','Success'), HOF_PUBLIC);
132
+	$player->increaseHOF($gained_exp, array('Trade', 'Experience', 'Total'), HOF_PUBLIC);
133
+	$player->increaseHOF(1, array('Trade', 'Results', 'Success'), HOF_PUBLIC);
134 134
 
135 135
 	// log action
136
-	$account->log(LOG_TYPE_TRADING, $transaction . 's '.$amount.' '.$good_name.' for '.$bargain_price.' credits and '.$gained_exp.' experience', $player->getSectorID());
136
+	$account->log(LOG_TYPE_TRADING, $transaction . 's ' . $amount . ' ' . $good_name . ' for ' . $bargain_price . ' credits and ' . $gained_exp . ' experience', $player->getSectorID());
137 137
 
138 138
 	$player->increaseExperience($gained_exp);
139 139
 
140 140
 	// change relation for non neutral ports (Alskants get to treat neutrals as an alskant port);
141 141
 	if ($port->getRaceID() != RACE_NEUTRAL || $player->getRaceID() == RACE_ALSKANT) {
142
-		$player->increaseRelationsByTrade($amount,$port->getRaceID());
142
+		$player->increaseRelationsByTrade($amount, $port->getRaceID());
143 143
 	}
144 144
 
145 145
 	//will use these variables in current sector and port after successful trade
146
-	$tradeMessage = 'You have just '.$msg_transaction.' <span class="yellow">'.$amount.'</span> '.pluralise('unit', $amount).' of <span class="yellow">'.$good_name.'</span>';
146
+	$tradeMessage = 'You have just ' . $msg_transaction . ' <span class="yellow">' . $amount . '</span> ' . pluralise('unit', $amount) . ' of <span class="yellow">' . $good_name . '</span>';
147 147
 	if ($bargain_price > 0) {
148
-		$tradeMessage .= ' for <span class="creds">'.$bargain_price.'</span> '.pluralise('credit', $bargain_price);
148
+		$tradeMessage .= ' for <span class="creds">' . $bargain_price . '</span> ' . pluralise('credit', $bargain_price);
149 149
 	}
150 150
 	$tradeMessage .= '.<br />';
151 151
 	if ($gained_exp > 0) {
152 152
 		$skill = $transaction == 'Steal' ? 'thievery' : 'trading';
153
-		$tradeMessage .= 'Your excellent '.$skill.' skills have earned you <span class="exp">'.$gained_exp.' </span> experience '.pluralise('point', $gained_exp).'!<br />';
153
+		$tradeMessage .= 'Your excellent ' . $skill . ' skills have earned you <span class="exp">' . $gained_exp . ' </span> experience ' . pluralise('point', $gained_exp) . '!<br />';
154 154
 	}
155 155
 	$tradeMessage .= '<br />';
156 156
 
@@ -167,7 +167,7 @@  discard block
 block discarded – undo
167 167
 	$container = create_container('skeleton.php', 'shop_goods_trade.php');
168 168
 	transfer('ideal_price');
169 169
 	transfer('offered_price');
170
-	check_bargain_number($amount,$ideal_price,$offered_price,$bargain_price,$container);
170
+	check_bargain_number($amount, $ideal_price, $offered_price, $bargain_price, $container);
171 171
 
172 172
 	// transfer values to next page
173 173
 	transfer('good_id');
@@ -177,8 +177,8 @@  discard block
 block discarded – undo
177 177
 }
178 178
 
179 179
 // only take turns if they bargained
180
-if (!isset($container['number_of_bargains'])||$container['number_of_bargains'] != 1)
181
-	$player->takeTurns(TURNS_PER_TRADE,TURNS_PER_TRADE);
180
+if (!isset($container['number_of_bargains']) || $container['number_of_bargains'] != 1)
181
+	$player->takeTurns(TURNS_PER_TRADE, TURNS_PER_TRADE);
182 182
 
183 183
 // go to next page
184 184
 forward($container);
Please login to merge, or discard this patch.
engine/Default/shop_goods_trade.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-$template->assign('PageTopic','Negotiate Price');
2
+$template->assign('PageTopic', 'Negotiate Price');
3 3
 require_once(LIB . 'Default/shop_goods.inc');
4 4
 // creates needed objects
5 5
 $port = $player->getSectorPort();
Please login to merge, or discard this patch.
engine/Default/buy_ship_name.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-$template->assign('PageTopic','Naming Your Ship');
3
+$template->assign('PageTopic', 'Naming Your Ship');
4 4
 
5
-if(isset($var['Preview'])) {
6
-	$template->assign('Preview',$var['Preview']);
7
-	$template->assign('ContinueHref',SmrSession::getNewHREF(create_container('skeleton.php','buy_ship_name_processing.php',array('ShipName'=>$var['Preview']))));
5
+if (isset($var['Preview'])) {
6
+	$template->assign('Preview', $var['Preview']);
7
+	$template->assign('ContinueHref', SmrSession::getNewHREF(create_container('skeleton.php', 'buy_ship_name_processing.php', array('ShipName'=>$var['Preview']))));
8 8
 }
9 9
 else {
10
-	$template->assign('ShipNameFormHref',SmrSession::getNewHREF(create_container('skeleton.php','buy_ship_name_processing.php')));
10
+	$template->assign('ShipNameFormHref', SmrSession::getNewHREF(create_container('skeleton.php', 'buy_ship_name_processing.php')));
11 11
 }
Please login to merge, or discard this patch.
engine/Default/alliance_roles_processing.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 if (!is_numeric($withPerDay) || ($withPerDay < 0 && $withPerDay != ALLIANCE_BANK_UNLIMITED)) {
20 20
 	create_error('You must enter a number for max withdrawals per 24 hours.');
21 21
 }
22
-if($withPerDay == ALLIANCE_BANK_UNLIMITED && $positiveBalance) {
22
+if ($withPerDay == ALLIANCE_BANK_UNLIMITED && $positiveBalance) {
23 23
 	create_error('You cannot have both unlimited withdrawals and a positive balance limit.');
24 24
 }
25 25
 
@@ -50,10 +50,10 @@  discard block
 block discarded – undo
50 50
 else {
51 51
 	// if no role is given we delete that entry
52 52
 	if (empty($_REQUEST['role'])) {
53
-		if($var['role_id']==1) {
53
+		if ($var['role_id'] == 1) {
54 54
 			create_error('You cannot delete the leader role.');
55 55
 		}
56
-		else if($var['role_id']==2) {
56
+		else if ($var['role_id'] == 2) {
57 57
 			create_error('You cannot delete the new member role.');
58 58
 		}
59 59
 		$db->query('DELETE FROM alliance_has_roles
Please login to merge, or discard this patch.
engine/Default/bar_ticker_buy.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -4,14 +4,14 @@  discard block
 block discarded – undo
4 4
 	if ($account->getTotalSmrCredits() < CREDITS_PER_TICKER) {
5 5
 		create_error('You don\'t have enough SMR Credits.  Donate money to SMR to gain SMR Credits!');
6 6
 	}
7
-	if(isset($_REQUEST['type'])) {
8
-		SmrSession::updateVar('type',$_REQUEST['type']);
7
+	if (isset($_REQUEST['type'])) {
8
+		SmrSession::updateVar('type', $_REQUEST['type']);
9 9
 	}
10 10
 	$type = $var['type'];
11
-	if(empty($type)) {
11
+	if (empty($type)) {
12 12
 		create_error('You have to choose the type of ticker to buy.');
13 13
 	}
14
-	switch($type) {
14
+	switch ($type) {
15 15
 		case 'NEWS':
16 16
 		case 'SCOUT':
17 17
 		case 'BLOCK':
@@ -21,15 +21,15 @@  discard block
 block discarded – undo
21 21
 	}
22 22
 	$expires = TIME;
23 23
 	$ticker = $player->getTicker($type);
24
-	if($ticker !== false) {
24
+	if ($ticker !== false) {
25 25
 		$expires = $ticker['Expires'];
26 26
 	}
27
-	$expires += 5*86400;
27
+	$expires += 5 * 86400;
28 28
 	$db->query('REPLACE INTO player_has_ticker (game_id, account_id, type, expires) VALUES (' . $db->escapeNumber($player->getGameID()) . ', ' . $db->escapeNumber($player->getAccountID()) . ', ' . $db->escapeString($type) . ', ' . $db->escapeNumber($expires) . ')');
29 29
 	//take credits
30 30
 	$account->decreaseTotalSmrCredits(CREDITS_PER_TICKER);
31 31
 	//offer another drink and such
32
-	$container=create_container('skeleton.php','bar_main.php');
32
+	$container = create_container('skeleton.php', 'bar_main.php');
33 33
 	transfer('LocationID');
34 34
 	$container['message'] = '<div align="center">Your system has been added.  Enjoy!</div><br />';
35 35
 	forward($container);
Please login to merge, or discard this patch.
engine/Default/message_blacklist_del.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 $container['url'] = 'skeleton.php';
5 5
 $container['body'] = 'message_blacklist.php';
6 6
 
7
-if(!isset($_REQUEST['entry_ids']) || !is_array($_REQUEST['entry_ids'])) {
7
+if (!isset($_REQUEST['entry_ids']) || !is_array($_REQUEST['entry_ids'])) {
8 8
 	$container['error'] = 4;	
9 9
 	forward($container);
10 10
 }
11 11
 
12
-foreach($_REQUEST['entry_ids'] as $entry_id) {
13
-	if(!is_numeric($entry_id)) {
12
+foreach ($_REQUEST['entry_ids'] as $entry_id) {
13
+	if (!is_numeric($entry_id)) {
14 14
 		$container['error'] = 5;	
15 15
 		forward($container);
16 16
 	}
Please login to merge, or discard this patch.
engine/Default/chat_sharing.php 1 patch
Spacing   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -19,8 +19,7 @@  discard block
 block discarded – undo
19 19
 	$shareFrom[$fromAccountId] = array(
20 20
 		'Player ID'   => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(),
21 21
 		'Player Name' => $otherPlayer == null ?
22
-		                 '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofName() :
23
-		                 $otherPlayer->getPlayerName(),
22
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofName() : $otherPlayer->getPlayerName(),
24 23
 		'All Games'   => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>',
25 24
 		'Game ID'     => $gameId,
26 25
 	);
@@ -40,8 +39,7 @@  discard block
 block discarded – undo
40 39
 	$shareTo[$toAccountId] = array(
41 40
 		'Player ID'   => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(),
42 41
 		'Player Name' => $otherPlayer == null ?
43
-		                 '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() :
44
-		                 $otherPlayer->getPlayerName(),
42
+		                 '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofName() : $otherPlayer->getPlayerName(),
45 43
 		'All Games'   => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>',
46 44
 		'Game ID'     => $gameId,
47 45
 	);
Please login to merge, or discard this patch.
engine/Default/edit_dummys.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,25 +1,25 @@  discard block
 block discarded – undo
1 1
 <?php
2
-$template->assign('PageTopic','Edit Dummys');
2
+$template->assign('PageTopic', 'Edit Dummys');
3 3
 
4 4
 //TODO add game type id
5
-$template->assign('CombatSimLink',SmrSession::getNewHREF(create_container('skeleton.php','combat_simulator.php')));
6
-$template->assign('BaseShips',AbstractSmrShip::getAllBaseShips(0));
7
-$template->assign('Weapons',SmrWeapon::getAllWeapons(0));
5
+$template->assign('CombatSimLink', SmrSession::getNewHREF(create_container('skeleton.php', 'combat_simulator.php')));
6
+$template->assign('BaseShips', AbstractSmrShip::getAllBaseShips(0));
7
+$template->assign('Weapons', SmrWeapon::getAllWeapons(0));
8 8
 
9
-$template->assign('EditDummysLink',SmrSession::getNewHREF(create_container('skeleton.php','edit_dummys.php')));
9
+$template->assign('EditDummysLink', SmrSession::getNewHREF(create_container('skeleton.php', 'edit_dummys.php')));
10 10
 
11
-$dummyPlayer =& DummyPlayer::getCachedDummyPlayer($_REQUEST['dummy_name']);
12
-$dummyShip =& $dummyPlayer->getShip();
11
+$dummyPlayer = & DummyPlayer::getCachedDummyPlayer($_REQUEST['dummy_name']);
12
+$dummyShip = & $dummyPlayer->getShip();
13 13
 
14
-if(isset($_REQUEST['save_dummy'])) {
14
+if (isset($_REQUEST['save_dummy'])) {
15 15
 	$dummyPlayer->setPlayerName($_REQUEST['dummy_name']);
16 16
 	$dummyPlayer->setExperience($_REQUEST['level']);
17 17
 	$dummyPlayer->setShipTypeID($_REQUEST['ship_id']);
18 18
 	$dummyShip->regenerate($dummyPlayer);
19
-	if(isset($_REQUEST['weapons']) && is_array($_REQUEST['weapons'])) {
19
+	if (isset($_REQUEST['weapons']) && is_array($_REQUEST['weapons'])) {
20 20
 		$dummyShip->removeAllWeapons();
21
-		foreach($_REQUEST['weapons'] as $weaponTypeID) {
22
-			if($weaponTypeID!=0) {
21
+		foreach ($_REQUEST['weapons'] as $weaponTypeID) {
22
+			if ($weaponTypeID != 0) {
23 23
 				$dummyShip->addWeapon($weaponTypeID);
24 24
 			}
25 25
 		}
@@ -28,10 +28,10 @@  discard block
 block discarded – undo
28 28
 }
29 29
 
30 30
 
31
-$template->assign('DummyPlayer',$dummyPlayer);
32
-$template->assign('DummyShip',$dummyShip);
33
-$template->assign('ShipWeapons',$dummyShip->getWeapons());
34
-$template->assign('Levels',Globals::getLevelRequirements());
31
+$template->assign('DummyPlayer', $dummyPlayer);
32
+$template->assign('DummyShip', $dummyShip);
33
+$template->assign('ShipWeapons', $dummyShip->getWeapons());
34
+$template->assign('Levels', Globals::getLevelRequirements());
35 35
 
36 36
 
37 37
 
Please login to merge, or discard this patch.
engine/Default/buy_message_notifications_processing.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if($account->getTotalSmrCredits() < 1) {
3
+if ($account->getTotalSmrCredits() < 1) {
4 4
 	create_error('You do not have enough SMR credits.');
5 5
 }
6 6
 
7 7
 $account->decreaseTotalSmrCredits(1);
8 8
 $account->increaseMessageNotifications($var['MessageTypeID'], MESSAGES_PER_CREDIT[$var['MessageTypeID']]);
9 9
 
10
-forward(create_container('skeleton.php', 'buy_message_notifications.php', array('Message' => '<span class="green">SUCCESS</span>: You have purchased '.MESSAGES_PER_CREDIT[$var['MessageTypeID']].' message notifications.')));
10
+forward(create_container('skeleton.php', 'buy_message_notifications.php', array('Message' => '<span class="green">SUCCESS</span>: You have purchased ' . MESSAGES_PER_CREDIT[$var['MessageTypeID']] . ' message notifications.')));
Please login to merge, or discard this patch.