From d3a58e2e487ac45a69d12cbeebc9b8ee31807b99 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 21 Mar 2024 13:21:33 +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/fichinter/class/fichinter.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/htdocs/fichinter/class/fichinter.class.php b/htdocs/fichinter/class/fichinter.class.php index f5b57037c0d..d54497125c1 100644 --- a/htdocs/fichinter/class/fichinter.class.php +++ b/htdocs/fichinter/class/fichinter.class.php @@ -200,17 +200,17 @@ class Fichinter extends CommonObject /* * Signed by sender */ - CONST STATUS_SIGNED_SENDER = 1; + const STATUS_SIGNED_SENDER = 1; /* * Signed by receiver */ - CONST STATUS_SIGNED_RECEIVER = 2; + const STATUS_SIGNED_RECEIVER = 2; /* * Signed by all */ - CONST STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) + const STATUS_SIGNED_ALL = 9; // To handle future kind of signature (ex: tripartite contract) /** * Date delivery @@ -1010,7 +1010,7 @@ class Fichinter extends CommonObject $dir = dol_buildpath($reldir."core/modules/fichinter/"); // Load file with numbering class (if found) - $mybool |= @include_once $dir.$file; + $mybool = ((bool) @include_once $dir.$file) || $mybool; } if ($mybool === false) {