🐞 fix: phpcs issue cleanup
This commit is contained in:
@@ -18,7 +18,7 @@ require_once __DIR__ . '/lib/spacetraders-storage.php';
|
||||
*
|
||||
* @return array<int,array<string,mixed>>
|
||||
*/
|
||||
function spacetraders_filter_mining_ships( array $ships ): array {
|
||||
function filterMiningShips( array $ships ): array {
|
||||
return array_values(
|
||||
array_filter(
|
||||
$ships,
|
||||
@@ -76,7 +76,7 @@ try {
|
||||
$agent = $agentResponse['data'] ?? $agentResponse;
|
||||
$ships = $shipsResponse['data'] ?? $shipsResponse;
|
||||
$contracts = $contractsResponse['data'] ?? $contractsResponse;
|
||||
$miningShips = spacetraders_filter_mining_ships( $ships );
|
||||
$miningShips = filterMiningShips( $ships );
|
||||
$activeContracts = array_values(
|
||||
array_filter(
|
||||
(array) $contracts,
|
||||
@@ -291,7 +291,7 @@ try {
|
||||
$contractsResponse = $client->listMyContracts();
|
||||
$ships = $shipsResponse['data'] ?? $shipsResponse;
|
||||
$contracts = $contractsResponse['data'] ?? $contractsResponse;
|
||||
$miningShips = spacetraders_filter_mining_ships( $ships );
|
||||
$miningShips = filterMiningShips( $ships );
|
||||
$activeContracts = array_values(
|
||||
array_filter(
|
||||
(array) $contracts,
|
||||
@@ -302,12 +302,7 @@ try {
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
$_SERVER['REQUEST_METHOD'] === 'POST' &&
|
||||
isset( $_POST['ship_action'] ) &&
|
||||
in_array( (string) $_POST['ship_action'], array( 'sell_ship_cargo', 'jettison_ship_cargo' ), true ) &&
|
||||
isset( $_POST['ship_symbol'] )
|
||||
) {
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset( $_POST['ship_action'] ) && in_array( (string) $_POST['ship_action'], array( 'sell_ship_cargo', 'jettison_ship_cargo' ), true ) && isset( $_POST['ship_symbol'] )) {
|
||||
$shipAction = (string) $_POST['ship_action'];
|
||||
$sellShipSymbol = trim( (string) $_POST['ship_symbol'] );
|
||||
|
||||
@@ -355,7 +350,7 @@ try {
|
||||
|
||||
$shipsResponse = $client->listMyShips();
|
||||
$ships = $shipsResponse['data'] ?? $shipsResponse;
|
||||
$miningShips = spacetraders_filter_mining_ships( $ships );
|
||||
$miningShips = filterMiningShips( $ships );
|
||||
} catch (SpacetradersApiException $e) {
|
||||
$errorMessage = $sellShipSymbol . ': ' . $e->getMessage();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user