diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 3be2c00a024..1dfab858066 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -6,12 +6,6 @@ parameters: count: 1 path: ../../../htdocs/accountancy/admin/categories.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 2 - path: ../../../htdocs/accountancy/admin/categories_list.php - - message: '#^Loose comparison using \=\= between 32 and 32 will always evaluate to true\.$#' identifier: equal.alwaysTrue @@ -36,24 +30,12 @@ parameters: count: 1 path: ../../../htdocs/accountancy/admin/journals_list.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/accountancy/admin/productaccount.php - - message: '#^Right side of && is always true\.$#' identifier: booleanAnd.rightAlwaysTrue count: 1 path: ../../../htdocs/accountancy/admin/productaccount.php - - - message: '#^If condition is always true\.$#' - identifier: if.alwaysTrue - count: 1 - path: ../../../htdocs/accountancy/admin/report_list.php - - message: '#^Loose comparison using \=\= between 45 and 45 will always evaluate to true\.$#' identifier: equal.alwaysTrue diff --git a/htdocs/accountancy/admin/categories_list.php b/htdocs/accountancy/admin/categories_list.php index 0b91f2e22b6..2e4350ad643 100644 --- a/htdocs/accountancy/admin/categories_list.php +++ b/htdocs/accountancy/admin/categories_list.php @@ -1,7 +1,7 @@ * Copyright (C) 2011-2025 Alexandre Spangaro - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024-2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -465,9 +465,7 @@ $paramwithsearch = $param; if ($sortorder) { $paramwithsearch .= '&sortorder='.urlencode($sortorder); } -if ($sortfield) { - $paramwithsearch .= '&sortfield='.urlencode($sortfield); -} +$paramwithsearch .= '&sortfield='.urlencode($sortfield); if (GETPOST('from', 'alpha')) { $paramwithsearch .= '&from='.urlencode(GETPOST('from', 'alpha')); } @@ -825,9 +823,7 @@ if ($resql) { } } $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : ''); - if ($param) { - $url .= '&'.$param; - } + $url .= '&'.$param; $url .= '&'; $canbemodified = $iserasable; diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php index e3390afcd8e..6c5228dd14d 100644 --- a/htdocs/accountancy/admin/productaccount.php +++ b/htdocs/accountancy/admin/productaccount.php @@ -6,7 +6,7 @@ * Copyright (C) 2015 Ari Elbaz (elarifr) * Copyright (C) 2021 Gauthier VERDOL * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -202,7 +202,7 @@ if ($action == 'update' && $permissiontobind) { $ko = 0; $msg = ''; $sql = ''; - if (!empty($toselect) && in_array($accounting_product_mode, $accounting_product_modes)) { // @phpstan-ignore-line Bug phpstan thinking that empty(array()) is always true + if (in_array($accounting_product_mode, $accounting_product_modes)) { $accounting = new AccountingAccount($db); $arrayofdifferentselectedvalues = array(); @@ -466,9 +466,9 @@ if ($resql) { if ($search_current_account_valid && $search_current_account_valid != '-1') { $param .= "&search_current_account_valid=".urlencode($search_current_account_valid); } - if ($accounting_product_mode) { - $param .= '&accounting_product_mode='.urlencode($accounting_product_mode); - } + // if ($accounting_product_mode) { // can't be empty see line 91-93 + $param .= '&accounting_product_mode='.urlencode($accounting_product_mode); + // } print '
'; if ($optioncss != '') { diff --git a/htdocs/accountancy/admin/report_list.php b/htdocs/accountancy/admin/report_list.php index 85208e80d1e..88258c7df5a 100644 --- a/htdocs/accountancy/admin/report_list.php +++ b/htdocs/accountancy/admin/report_list.php @@ -1,6 +1,6 @@ - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * 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 @@ -680,9 +680,7 @@ if ($resql) { } } $url = $_SERVER["PHP_SELF"].'?'.($page ? 'page='.$page.'&' : '').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(!empty($obj->rowid) ? $obj->rowid : (!empty($obj->code) ? $obj->code : '')).'&code='.(!empty($obj->code) ? urlencode($obj->code) : ''); - if ($param) { - $url .= '&'.$param; - } + $url .= '&'.$param; $url .= '&'; $canbemodified = $iserasable; diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 37b4aaefb1d..3cb5bfabccd 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -8,7 +8,7 @@ parameters: # should adapt better to target machines # jobSize: 8 # default is 20 processTimeout: 600.0 - # maximumNumberOfProcesses: 20 # default is 32 + maximumNumberOfProcesses: 4 # default is 32 # minimumNumberOfJobsPerProcess: 2 # default is 2 # buffer: 134217728 # 128 MB # Not documented customRulesetUsed: true