Code smell.

This commit is contained in:
Ivor Barhansky
2022-12-17 01:20:43 +02:00
parent b1f578f4b0
commit 0398425205
45 changed files with 875 additions and 851 deletions
+4 -4
View File
@@ -94,11 +94,11 @@ class UserEffect
* @param int $type
* @param string $name
* @param int $time
* @param string|null $json_modifiers_list (str, dex, int, end, intel, wis).
* @param string|null $jsonModifiersList (str, dex, int, end, intel, wis).
*/
public static function add(int $userId, int $type, string $name, int $time, string $json_modifiers_list = null)
public static function add(int $userId, int $type, string $name, int $time, string $jsonModifiersList = null)
{
$mods = json_decode($json_modifiers_list);
$mods = json_decode($jsonModifiersList);
Db::getInstance()->execute('INSERT INTO users_effects (owner_id, type, name, remaining_time, mod_strength, mod_dexterity, mod_intuition, mod_endurance, mod_intelligence, mod_wisdom) VALUES (?,?,?,?,?,?,?,?,?,?)', [$userId, $type, $name, $time, $mods->str ?? null, $mods->dex ?? null, $mods->int ?? null, $mods->end ?? null, $mods->intel ?? null, $mods->wis ?? null]);
}
@@ -159,4 +159,4 @@ class UserEffect
$query = 'select strength * 5 + ' . $addWeight . ' as max from inventory left join users u on owner_id = id where owner_id = ? having sum(weight) > max';
return Db::getInstance()->fetchColumn($query, $userid) > 0;
}
}
}