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:
parent
8a83388905
commit
8c29ca9033
1 changed files with 3 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue