From c6fa4e49453e9e90a7f0411c93701ba231b900cd Mon Sep 17 00:00:00 2001 From: MDW Date: Sat, 9 Mar 2024 20:44:47 +0100 Subject: [PATCH 1/4] Qual: Enable reporting PhanTypeMismatchDimAssignment --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index ee9cde2603f..f2fe12ea94c 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -448,7 +448,7 @@ return [ 'PhanRedefineClass', 'PhanRedefineFunction', 'PhanTypeInvalidLeftOperandOfBitwiseOp', - 'PhanTypeMismatchDimAssignment', + // 'PhanTypeMismatchDimAssignment', // 'PhanPluginDescriptionlessCommentOnProtectedMethod', 'PhanPluginPrintfIncompatibleArgumentTypeWeak', 'PhanUndeclaredVariableAssignOp', From 087390b44e4e8e8563797c3baa81f68f094a67dc Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:15:54 +0100 Subject: [PATCH 2/4] Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 50e83f65fcb..22165d2c305 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -2,6 +2,7 @@ /* Copyright (C) 2017 Laurent Destailleur * Copyright (C) 2017 Regis Houssin * Copyright (C) 2022 Charlene Benke + * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -167,7 +168,10 @@ foreach ($modulesdir as $dir) { $familyinfo = array_merge($familyinfo, $objMod->familyinfo); $familykey = key($objMod->familyinfo); } else { - $familykey = empty($objMod->family) ? 'other' : $objMod->family; + $familykey = $objMod->family; + if (empty($familykey)) { + $familykey = 'other'; + } } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50'); From 6b34b8757f9a7821e1cde07420a2602920e2987e Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 17:43:57 +0100 Subject: [PATCH 3/4] fixup! Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 22165d2c305..8116316dfa1 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -169,7 +169,7 @@ foreach ($modulesdir as $dir) { $familykey = key($objMod->familyinfo); } else { $familykey = $objMod->family; - if (empty($familykey)) { + if (empty($familykey) || $familykey === null) { $familykey = 'other'; } } From fc6c93877b369d6974c0732072882de70c071971 Mon Sep 17 00:00:00 2001 From: MDW Date: Mon, 11 Mar 2024 18:02:19 +0100 Subject: [PATCH 4/4] fixup! Change logic to help static tool analysis --- htdocs/admin/modulehelp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/admin/modulehelp.php b/htdocs/admin/modulehelp.php index 8116316dfa1..e076187e563 100644 --- a/htdocs/admin/modulehelp.php +++ b/htdocs/admin/modulehelp.php @@ -169,9 +169,9 @@ foreach ($modulesdir as $dir) { $familykey = key($objMod->familyinfo); } else { $familykey = $objMod->family; - if (empty($familykey) || $familykey === null) { - $familykey = 'other'; - } + } + if (empty($familykey) || $familykey === null) { + $familykey = 'other'; } $moduleposition = ($objMod->module_position ? $objMod->module_position : '50');