Skip to content

Commit

Permalink
Strict typing at top of file, and handle variable types more accurately
Browse files Browse the repository at this point in the history
  • Loading branch information
thekabal committed Mar 15, 2017
1 parent d667dc8 commit 3e02508
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lrscan.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php declare(strict_types = 1);
// The Kabal Invasion - A web-based 4X space game
// Copyright © 2014 The Kabal Invasion development team, Ron Harwood, and the BNT development team
//
Expand Down Expand Up @@ -133,7 +133,17 @@
Tki\Db::LogDbErrors($pdo_db, $resultSDb, __LINE__, __FILE__);

$defM = $resultSDa->fields;
if ($defM['mines'] === null)
{
$defM['mines'] = 0;
}

$defF = $resultSDb->fields;
if ($defF['fighters'] === null)
{
$defF['fighters'] = 0;
}

$port_type = $sectorinfo['port_type'];
$has_planet = $result3->RecordCount();
$has_mines = number_format($defM['mines'], 0, $langvars['local_number_dec_point'], $langvars['local_number_thousands_sep']);
Expand Down

0 comments on commit 3e02508

Please sign in to comment.