Skip to content

Commit

Permalink
PSR2 compliance suggested via slevomat - PSR2.Methods.FunctionCallSig…
Browse files Browse the repository at this point in the history
…nature.SpaceBeforeOpenBracket
  • Loading branch information
thekabal committed Mar 14, 2017
1 parent 04e7883 commit bcbb3a3
Show file tree
Hide file tree
Showing 29 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
$button_main = false;

// Clear variables array before use, and set array with all variables in page
unset ($variables);
unset($variables);
$variables = array();

$variables['is_admin'] = false;
Expand Down
4 changes: 2 additions & 2 deletions admin/bans_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
$res->MoveNext();
}

if (empty ($bans))
if (empty($bans))
{
echo "<strong>" . $langvars['l_admin_no_bans'] . "</strong>";
}
Expand Down Expand Up @@ -331,7 +331,7 @@
}

echo "<p><strong>" . $langvars['l_admin_affected_players'] . " :</strong><p>";
if (empty ($players))
if (empty($players))
{
echo " - " . $langvars['l_none'] . "<br>";
}
Expand Down
2 changes: 1 addition & 1 deletion admin/user_editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$_POST['operation'] = null;
}

if (empty ($_POST['user']))
if (empty($_POST['user']))
{
$res = $db->Execute("SELECT ship_id, character_name FROM {$db->prefix}ships ORDER BY character_name");
Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__);
Expand Down
2 changes: 1 addition & 1 deletion classes/KabalTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ public static function ship(\PDO $pdo_db, $db, int $ship_id, Reg $tkireg, array
}

$ship_value = $tkireg->upgrade_cost * (round(pow($tkireg->upgrade_factor, $targetinfo['hull'])) + round(pow($tkireg->upgrade_factor, $targetinfo['engines'])) + round(pow($tkireg->upgrade_factor, $targetinfo['power'])) + round(pow($tkireg->upgrade_factor, $targetinfo['computer'])) + round(pow($tkireg->upgrade_factor, $targetinfo['sensors'])) + round(pow($tkireg->upgrade_factor, $targetinfo['beams'])) + round(pow($tkireg->upgrade_factor, $targetinfo['torp_launchers'])) + round(pow($tkireg->upgrade_factor, $targetinfo['shields'])) + round(pow($tkireg->upgrade_factor, $targetinfo['armor'])) + round(pow($tkireg->upgrade_factor, $targetinfo['cloak'])));
$ship_salvage_rate = random_int (10, 20);
$ship_salvage_rate = random_int(10, 20);
$ship_salvage = $ship_value * $ship_salvage_rate / 100;
\Tki\PlayerLog::writeLog($pdo_db, $playerinfo['ship_id'], LOG_RAW, "Attack successful, $targetinfo[character_name] was defeated and salvaged for $ship_salvage credits.");
$resd = $db->Execute("UPDATE {$db->prefix}ships SET ship_ore = ship_ore + ?, ship_organics = ship_organics + ?, ship_goods = ship_goods + ?, credits = credits + ? WHERE ship_id = ?;", array($salv_ore, $salv_organics, $salv_goods, $ship_salvage, $playerinfo['ship_id']));
Expand Down
2 changes: 1 addition & 1 deletion classes/PlanetProduction.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public static function productionChange(\PDO $pdo_db, $db, array $langvars, arra

foreach ($planets as $planet)
{
if (empty ($planet['name']))
if (empty($planet['name']))
{
$planet['name'] = $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion classes/PlanetReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static function standardReport(\PDO $pdo_db, array $langvars, array $play
$total_selling++;
}

if (empty ($planet[$i]['name']))
if (empty($planet[$i]['name']))
{
$planet[$i]['name'] = $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion classes/PlanetReportCE.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static function takeCredits(\PDO $pdo_db, $db, array $langvars, int $plan
$planetinfo = $res->fields;

// Set the name for unamed planets to be "unnamed"
if (empty ($planetinfo['name']))
if (empty($planetinfo['name']))
{
$planetinfo['name'] = $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Realspace.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function realSpaceMove(\PDO $pdo_db, array $langvars, int $destina
}

// Make sure energyscooped is not null
if (!isset ($energyscooped))
if (!isset($energyscooped))
{
$energyscooped = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/Team.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static function validateTeam(\PDO $pdo_db, $name = null, $desc = null, $c
$desc = trim($desc);
$creator = (int) $creator;

if ($name === null || empty ($name) || $desc === null || empty ($desc) || $creator === null || empty ($creator))
if ($name === null || empty($name) || $desc === null || empty($desc) || $creator === null || empty($creator))
{
return (bool) false;
}
Expand Down
4 changes: 2 additions & 2 deletions classes/TraderouteBuild.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public static function create(\PDO $pdo_db, $db, string $lang, Reg $tkireg, Smar
$src_type = null;
$dest_type = null;

if ($num_traderoutes >= $tkireg->max_traderoutes_player && empty ($editing))
if ($num_traderoutes >= $tkireg->max_traderoutes_player && empty($editing))
{ // Dont let them exceed max traderoutes
\Tki\TraderouteDie::die($pdo_db, $lang, $tkireg, $template, $langvars['l_tdr_maxtdr']);
}
Expand Down Expand Up @@ -615,7 +615,7 @@ public static function create(\PDO $pdo_db, $db, string $lang, Reg $tkireg, Smar
$mtype = 'W';
}

if (empty ($editing))
if (empty($editing))
{
$query = $db->Execute("INSERT INTO {$db->prefix}traderoutes VALUES(NULL, ?, ?, ?, ?, ?, ?, ?);", array($src_id, $dest_id, $src_type, $dest_type, $mtype, $playerinfo['ship_id'], $circuit_type));
\Tki\Db::logDbErrors($pdo_db, $query, __LINE__, __FILE__);
Expand Down
2 changes: 1 addition & 1 deletion classes/TraderouteDelete.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static function prime(\PDO $pdo_db, $db, string $lang, array $langvars, R
\Tki\TraderouteDie::die($pdo_db, $lang, $tkireg, $template, $langvars['l_tdr_notowntdr']);
}

if (!empty ($confirm))
if (!empty($confirm))
{
$query = $db->Execute("DELETE FROM {$db->prefix}traderoutes WHERE traderoute_id = ?;", array($traderoute_id));
\Tki\Db::logDbErrors($pdo_db, $query, __LINE__, __FILE__);
Expand Down
6 changes: 3 additions & 3 deletions classes/TraderouteSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ public static function after(\PDO $pdo_db, $db, string $lang, Reg $tkireg, Smart
{
$langvars = \Tki\Translate::load($pdo_db, $lang, array('traderoutes', 'common', 'global_includes', 'global_funcs', 'footer', 'regional'));

empty ($colonists) ? $colonists = 'N' : $colonists = 'Y';
empty ($fighters) ? $fighters = 'N' : $fighters = 'Y';
empty ($torps) ? $torps = 'N' : $torps = 'Y';
empty($colonists) ? $colonists = 'N' : $colonists = 'Y';
empty($fighters) ? $fighters = 'N' : $fighters = 'Y';
empty($torps) ? $torps = 'N' : $torps = 'Y';

$resa = $db->Execute("UPDATE {$db->prefix}ships SET trade_colonists = ?, trade_fighters = ?, trade_torps = ?, trade_energy = ? WHERE ship_id = ?;", array($colonists, $fighters, $torps, $energy, $playerinfo['ship_id']));
\Tki\Db::logDbErrors($pdo_db, $resa, __LINE__, __FILE__);
Expand Down
2 changes: 1 addition & 1 deletion faq.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
$variables['body_class'] = 'faq';
$variables['title'] = $langvars['l_faq_title'];

if (empty ($_SESSION['username']))
if (empty($_SESSION['username']))
{
$variables['linkback'] = array("fulltext" => $langvars['l_global_mlogin'], "link" => "index.php");
}
Expand Down
2 changes: 1 addition & 1 deletion feedback.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}

echo "<br>\n";
if (empty ($_SESSION['username']))
if (empty($_SESSION['username']))
{
echo str_replace("[here]", "<a href='index.php'>" . $langvars['l_here'] . "</a>", $langvars['l_global_mlogin']);
}
Expand Down
2 changes: 1 addition & 1 deletion footer_t.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
$slash_position = mb_strrpos($request->server->get('SCRIPT_NAME'), '/') + 1;
$current_page = mb_substr($request->server->get('SCRIPT_NAME'), $slash_position);

unset ($variables);
unset($variables);
$variables = array();

if (in_array($current_page, $public_pages))
Expand Down
2 changes: 1 addition & 1 deletion kabal_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@
{
echo "<span style=\"font-family : courier, monospace; font-size: 12pt; color: #0f0 \">kabal Editor</span><br>";
echo "<form accept-charset='utf-8' action=kabal_control.php method=post>";
if (empty ($user))
if (empty($user))
{
echo "<select size=20 name=user>";
$res = $db->Execute("SELECT email, character_name, ship_destroyed, active, sector FROM {$db->prefix}ships JOIN {$db->prefix}kabal WHERE email = kabal_id ORDER BY sector;");
Expand Down
2 changes: 1 addition & 1 deletion log.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
echo "<td colspan=2><table border=1 width=100%><tr><td bgcolor=#63639C>";
}

if (empty ($startdate))
if (empty($startdate))
{
$startdate = date("Y-m-d");
}
Expand Down
2 changes: 1 addition & 1 deletion logout.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

require_once './common.php';

unset ($variables);
unset($variables);
$variables = array();

// Database driven language entries
Expand Down
2 changes: 1 addition & 1 deletion lrscan.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
while (!$query->EOF)
{
$planet = $query->fields;
if (empty ($planet['name']))
if (empty($planet['name']))
{
echo $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion mailto.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@

echo "<h1>" . $title . "</h1>\n";

if (empty ($content))
if (empty($content))
{
$res = $db->Execute("SELECT character_name FROM {$db->prefix}ships WHERE email NOT LIKE '%@Kabal' AND ship_id <> ? ORDER BY character_name ASC;", array($playerinfo['ship_id']));
Tki\Db::LogDbErrors($pdo_db, $res, __LINE__, __FILE__);
Expand Down
4 changes: 2 additions & 2 deletions main.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@

echo " <tr>\n";
echo " <td style='text-align:left; color:#ccc; font-size:12px;'>&nbsp;{$langvars['l_sector']} <span style='color:#fff; font-weight:bold;'>{$playerinfo['sector']}</span></td>\n";
if (empty ($sectorinfo['beacon']) || mb_strlen(trim($sectorinfo['beacon'])) == 0)
if (empty($sectorinfo['beacon']) || mb_strlen(trim($sectorinfo['beacon'])) == 0)
{
$sectorinfo['beacon'] = null;
}
Expand Down Expand Up @@ -542,7 +542,7 @@
echo "<a href='planet.php?planet_id={$planets[$i]['planet_id']}'>";
echo "<img class='mnu' title='Interact with Planet' src=\"" . $template->getVariables('template_dir') . "/images/$planettypes[$planetlevel]\" style='width:79px; height:90px; border:0' alt=\"planet\"></a><br><span style='font-size:10px; color:#fff;'>";

if (empty ($planets[$i]['name']))
if (empty($planets[$i]['name']))
{
echo $langvars['l_unnamed'];
}
Expand Down
4 changes: 2 additions & 2 deletions mines.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,12 @@
{
$nummines = preg_replace('/[^0-9]/', '', $nummines);
$numfighters = preg_replace('/[^0-9]/', '', $numfighters);
if (empty ($nummines))
if (empty($nummines))
{
$nummines = 0;
}

if (empty ($numfighters))
if (empty($numfighters))
{
$numfighters = 0;
}
Expand Down
2 changes: 1 addition & 1 deletion news.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
echo "</table>\n";
echo "<div style=\"height:16px;\"></div>\n";

if (empty ($_SESSION['username']))
if (empty($_SESSION['username']))
{
echo str_replace('[here]', "<a href='index.php" . $link . "'>" . $langvars['l_here'] . '</a>', $langvars['l_global_mlogin']);
}
Expand Down
2 changes: 1 addition & 1 deletion planet.php
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@
Tki\PlayerLog::WriteLog($pdo_db, $ownerinfo['ship_id'], LOG_PLANET_SCAN, "$planetinfo[name]|$playerinfo[sector]|$playerinfo[character_name]");
// Scramble results by scan error factor.
$sc_error = Tki\Scan::error($playerinfo['sensors'], $ownerinfo['cloak'], $scan_error_factor);
if (empty ($planetinfo['name']))
if (empty($planetinfo['name']))
{
$planetinfo['name'] = $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion planet3.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
die();
}

if (empty ($planetinfo))
if (empty($planetinfo))
{
echo $langvars['l_planet_none'] . "<br>";
Tki\Text::gotoMain($pdo_db, $lang);
Expand Down
2 changes: 1 addition & 1 deletion ranking.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
$template->addVariables('players', $player_list);
}

if (empty ($_SESSION['username']))
if (empty($_SESSION['username']))
{
$variables['loggedin'] = (bool) true;
$variables['linkback'] = array('caption' => $langvars['l_global_mlogin'], 'link' => 'index.php');
Expand Down
2 changes: 1 addition & 1 deletion settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
$variables['template'] = $tkireg->default_template;


if (empty ($_SESSION['username']))
if (empty($_SESSION['username']))
{
$variables['loggedin'] = (bool) true;
$variables['linkback'] = array('caption' => $langvars['l_global_mlogin'], 'link' => 'index.php');
Expand Down
2 changes: 1 addition & 1 deletion team_planets.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
$total_selling++;
}

if (empty ($planet[$i]['name']))
if (empty($planet[$i]['name']))
{
$planet[$i]['name'] = $langvars['l_unnamed'];
}
Expand Down
2 changes: 1 addition & 1 deletion traderoute.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
}
else
{
if (empty ($planet1))
if (empty($planet1))
{
echo "&nbsp;" . $langvars['l_tdr_na'] . "</font></td>";
}
Expand Down

0 comments on commit bcbb3a3

Please sign in to comment.