We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -20,8 +20,7 @@ |
||
| 20 | 20 | if ($join === false) { |
| 21 | 21 | create_error('Join Date is not valid!'); |
| 22 | 22 | } |
| 23 | -$start = empty(Smr\Request::get('game_start')) ? $join : |
|
| 24 | - DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_start')); |
|
| 23 | +$start = empty(Smr\Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_start')); |
|
| 25 | 24 | if ($start === false) { |
| 26 | 25 | create_error('Start Date is not valid!'); |
| 27 | 26 | } |
@@ -4,8 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | // Get the dates ("|" sets hr/min/sec to 0) |
| 6 | 6 | $join = DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_join')); |
| 7 | -$start = empty(Smr\Request::get('game_start')) ? $join : |
|
| 8 | - DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_start')); |
|
| 7 | +$start = empty(Smr\Request::get('game_start')) ? $join : DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_start')); |
|
| 9 | 8 | $end = DateTime::createFromFormat('d/m/Y|', Smr\Request::get('game_end')); |
| 10 | 9 | |
| 11 | 10 | $game = SmrGame::getGame($var['game_id']); |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | |
| 11 | 11 | $container = Page::create('skeleton.php', 'current_sector.php'); |
| 12 | 12 | |
| 13 | -$container['msg'] = match ($result) { |
|
| 13 | +$container['msg'] = match($result) { |
|
| 14 | 14 | 0 => '[color=green]Success:[/color] You have resigned from [chess=' . $var['ChessGameID'] . '].', |
| 15 | 15 | 1 => '[color=green]Success:[/color] [chess=' . $var['ChessGameID'] . '] has been cancelled.', |
| 16 | 16 | }; |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | $container = Page::create('skeleton.php'); |
| 15 | 15 | $container->addVar('LocationID'); |
| 16 | 16 | |
| 17 | -[$type, $body] = match (true) { |
|
| 17 | +[$type, $body] = match(true) { |
|
| 18 | 18 | $location->isHQ() => ['HQ', 'government.php'], |
| 19 | 19 | $location->isUG() => ['UG', 'underground.php'], |
| 20 | 20 | }; |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | if ($board[$y][$x] != null) { |
| 19 | 19 | $colour = $chessGame->getColourForAccountID($player->getAccountID()); |
| 20 | 20 | $result = $chessGame->tryMove($x, $y, $toX, $toY, $colour, Smr\Chess\ChessPiece::QUEEN); |
| 21 | - $container['MoveMessage'] = match ($result) { |
|
| 21 | + $container['MoveMessage'] = match($result) { |
|
| 22 | 22 | 0 => '', // valid move, no message |
| 23 | 23 | 1 => 'You have just checkmated your opponent, congratulations!', |
| 24 | 24 | 2 => 'There is no piece in that square.', |
@@ -71,7 +71,7 @@ |
||
| 71 | 71 | if (!$game->hasStarted()) { |
| 72 | 72 | $turnsMessage = 'The game will start in ' . format_time($game->getStartTime() - Smr\Epoch::time()) . '!'; |
| 73 | 73 | } else { |
| 74 | - $turnsMessage = match ($player->getTurnsLevel()) { |
|
| 74 | + $turnsMessage = match($player->getTurnsLevel()) { |
|
| 75 | 75 | 'NONE' => '<span class="red">WARNING</span>: You have run out of turns!', |
| 76 | 76 | 'LOW' => '<span class="red">WARNING</span>: You are almost out of turns!', |
| 77 | 77 | 'MEDIUM' => '<span class="yellow">WARNING</span>: You are running out of turns!', |
@@ -26,8 +26,7 @@ discard block |
||
| 26 | 26 | $shareFrom[$fromAccountId] = [ |
| 27 | 27 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 28 | 28 | 'Player Name' => $otherPlayer == null ? |
| 29 | - '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : |
|
| 30 | - $otherPlayer->getDisplayName(), |
|
| 29 | + '<b>Account</b>: ' . SmrAccount::getAccount($fromAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
| 31 | 30 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 32 | 31 | 'Game ID' => $gameId, |
| 33 | 32 | ]; |
@@ -47,8 +46,7 @@ discard block |
||
| 47 | 46 | $shareTo[$toAccountId] = [ |
| 48 | 47 | 'Player ID' => $otherPlayer == null ? '-' : $otherPlayer->getPlayerID(), |
| 49 | 48 | 'Player Name' => $otherPlayer == null ? |
| 50 | - '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : |
|
| 51 | - $otherPlayer->getDisplayName(), |
|
| 49 | + '<b>Account</b>: ' . SmrAccount::getAccount($toAccountId)->getHofDisplayName() : $otherPlayer->getDisplayName(), |
|
| 52 | 50 | 'All Games' => $gameId == 0 ? '<span class="green">YES</span>' : '<span class="red">NO</span>', |
| 53 | 51 | 'Game ID' => $gameId, |
| 54 | 52 | ]; |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | $menuItems[] = ['Link' => Globals::getPlanetListHREF($alliance_id), 'Text' => 'Defense']; |
| 39 | 39 | $menuItems[] = ['Link' => Globals::getPlanetListFinancialHREF($alliance_id), 'Text' => 'Financial']; |
| 40 | 40 | // make the selected index bold |
| 41 | - $boldItem =& $menuItems[$selected_index]['Text']; |
|
| 41 | + $boldItem = & $menuItems[$selected_index]['Text']; |
|
| 42 | 42 | $boldItem = '<span class="bold">' . $boldItem . '</span>'; |
| 43 | 43 | |
| 44 | 44 | $template = Smr\Template::getInstance(); |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | 'Text' => 'Game News', |
| 146 | 146 | ]; |
| 147 | 147 | // make the selected index bold |
| 148 | - $boldItem =& $menuItems[$selected_index]['Text']; |
|
| 148 | + $boldItem = & $menuItems[$selected_index]['Text']; |
|
| 149 | 149 | $boldItem = '<b>' . $boldItem . '</b>'; |
| 150 | 150 | |
| 151 | 151 | $template = Smr\Template::getInstance(); |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | public function enteringSector(AbstractSmrPlayer $player, int $movementType): void { |
| 261 | 261 | // send scout messages to user |
| 262 | 262 | $message = 'Your forces have spotted ' . $player->getBBLink() . ' '; |
| 263 | - $message .= match ($movementType) { |
|
| 263 | + $message .= match($movementType) { |
|
| 264 | 264 | MOVEMENT_JUMP => 'jumping into', |
| 265 | 265 | MOVEMENT_WARP => 'warping into', |
| 266 | 266 | MOVEMENT_WALK => 'entering', |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | public function leavingSector(AbstractSmrPlayer $player, int $movementType): void { |
| 277 | 277 | // send scout messages to user |
| 278 | 278 | $message = 'Your forces have spotted ' . $player->getBBLink() . ' '; |
| 279 | - $message .= match ($movementType) { |
|
| 279 | + $message .= match($movementType) { |
|
| 280 | 280 | MOVEMENT_JUMP => 'jumping from', |
| 281 | 281 | MOVEMENT_WARP => 'warping from', |
| 282 | 282 | MOVEMENT_WALK => 'leaving', |
@@ -477,7 +477,7 @@ discard block |
||
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | public static function oppositeDir(string $dir): string { |
| 480 | - return match ($dir) { |
|
| 480 | + return match($dir) { |
|
| 481 | 481 | 'Up' => 'Down', |
| 482 | 482 | 'Down' => 'Up', |
| 483 | 483 | 'Left' => 'Right', |