From 8c29ca90334d73caa9396478a855fb9f3caeb484 Mon Sep 17 00:00:00 2001 From: MDW Date: Fri, 15 Mar 2024 20:17:05 +0100 Subject: [PATCH] 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 --- htdocs/hrm/class/skill.class.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index c895035010d..256956d55de 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -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);