From 170a9296564023dc1290fc2b9feb2933f239aad1 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 21 Mar 2024 13:21:06 +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/commande/class/commande.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 11e5a4adc8c..291ead61cd3 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -416,7 +416,7 @@ class Commande extends CommonOrder $dir = dol_buildpath($reldir."core/modules/commande/"); // Load file with numbering class (if found) - $mybool |= @include_once $dir.$file; + $mybool = ((bool) @include_once $dir.$file) || $mybool; } if ($mybool === false) {