정적 분석기 결과 반영

This commit is contained in:
2018-04-06 22:10:05 +09:00
parent d0e7358f68
commit 0639fc3b83
14 changed files with 173 additions and 101 deletions
+4
View File
@@ -21,6 +21,10 @@ class CityHelper{
$list = [];
$listInv = [];
$listByNation = [];
'@phan-var array<int,mixed>|null $list';
'@phan-var array<string,mixed>|null $listInv';
'@phan-var array<int,mixed>|null $listByNation';
foreach (DB::db()->query('SELECT `city` as `id`, `name`, `level`, `nation` from city') as $city) {
$id = $city['id'];
+3 -3
View File
@@ -20,7 +20,7 @@ class ChangeCity extends \sammo\Event\Action{
private $queries;
private $targetType = 'all';
private $targetArgs = [];
public function __construct($target = null, array $actions){
public function __construct($target, array $actions){
//values 포맷은 key, value로
@@ -74,7 +74,7 @@ class ChangeCity extends \sammo\Event\Action{
$matches = null;
if(preg_match(self::REGEXP_PERCENT, $value, $matches)){
$value = round($matches[1], 0);
$value = (int)round((float)$matches[1], 0);
return DB::db()->sqleval('%i', Util::valueFit($value, 0, 100));
}
@@ -106,7 +106,7 @@ class ChangeCity extends \sammo\Event\Action{
$matches = null;
if(preg_match(self::REGEXP_PERCENT, $value, $matches)){
$value = round($matches[1], 0);
$value = (int)round((float)$matches[1], 0);
return DB::db()->sqleval('ROUND(%b * %d, 0)', $keyMax, $value/100);
}