From c9d897ee356bc3cb93468bf38118df751d8e43f4 Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 21 Mar 2024 13:22:28 +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/workstation/class/workstation.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/workstation/class/workstation.class.php b/htdocs/workstation/class/workstation.class.php index c4b4cecc710..bed11601dc0 100644 --- a/htdocs/workstation/class/workstation.class.php +++ b/htdocs/workstation/class/workstation.class.php @@ -878,7 +878,7 @@ class Workstation extends CommonObject // Load file with numbering class (if found) if (file_exists($dir.$file)) { - $mybool |= @include_once $dir.$file; + $mybool = ((bool) @include_once $dir.$file) || $mybool; } }