From b3cda67e361eb5baef56a89cee7b1a5c709c769e Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 21 Mar 2024 13:21:54 +0100 Subject: [PATCH] Fix $mybool |=... which is binary op, not boolean op # Fix $mybool |=... which is binary op, not boolean op This fixes PhanTypeInvalidLeftOperandOfBitwiseOp. Replace $var |= ... with $var = ... || $var . Add cast before ... when needed (@include does not always return bool). |= always evaluates expression, there for || $var, not $var || --- htdocs/hrm/class/skill.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/hrm/class/skill.class.php b/htdocs/hrm/class/skill.class.php index b6759336016..4ce76501127 100644 --- a/htdocs/hrm/class/skill.class.php +++ b/htdocs/hrm/class/skill.class.php @@ -1001,7 +1001,7 @@ class Skill extends CommonObject $dir = dol_buildpath($reldir."core/modules/hrm/"); // Load file with numbering class (if found) - $mybool |= @include_once $dir.$file; + $mybool = ((bool) @include_once $dir.$file) || $mybool; } if ($mybool === false) {