Fix PhanNoopVariable for $i by changing loop to while

# Fix PhanNoopVariable for $i by changing loop to while

`$i` looked like a NOOP on $i which is provided as an argument to
the function.  Changed to while to improve readability and avoid thinking
that `$i` needs initialisation and fix the notification
This commit is contained in:
MDW 2024-03-15 20:17:05 +01:00
parent 8a83388905
commit 8c29ca9033
No known key found for this signature in database

View file

@ -259,7 +259,7 @@ class Skill extends CommonObject
$this->db->begin();
// Create level of skills
for ($i; $i <= $MaxNumberSkill ; $i++) {
while ($i <= $MaxNumberSkill) {
$skilldet = new Skilldet($this->db);
$skilldet->description = $defaultSkillDesc . " " . $i;
$skilldet->rankorder = $i;
@ -269,9 +269,10 @@ class Skill extends CommonObject
if ($result <= 0) {
$error++;
}
$i++;
}
if (! $error) {
if (!$error) {
$this->db->commit();
setEventMessage($langs->trans('SkillCreated'), $i);