From fd5048ef73ebbbbb5ee0bac7d8de9e6672c326b9 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 May 2019 19:12:33 +0200 Subject: [PATCH] Fix reported by phpstan --- htdocs/product/fournisseurs.php | 2 +- htdocs/product/price.php | 4 ++-- htdocs/societe/price.php | 6 +++--- phpstan.neon | 8 ++++++++ 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 67574b56318..6d43e4d4a3f 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -778,7 +778,7 @@ SCRIPT; $num = count($product_fourn_list); if (($num + ($offset * $limit)) < $nbtotalofrecords) $num++; - print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVEUR ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); + print_barre_liste($langs->trans('SupplierPrices'), $page, $_SERVER ['PHP_SELF'], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'title_accountancy.png', 0, '', '', $limit, 1); // Suppliers list title print '
'; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index 4b753e71838..f6efc0296b1 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -1851,7 +1851,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $backbutton='' . $langs->trans("Back") . ''; - print_barre_liste($title, $page, $_SERVEUR['PHP_SELF'], $option, $sortfield, $sortorder, $backbutton, count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); + print_barre_liste($title, $page, $_SERVER['PHP_SELF'], $option, $sortfield, $sortorder, $backbutton, count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); if (count($prodcustprice->lines) > 0) { @@ -1973,7 +1973,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) $option = '&search_soc=' . $search_soc . '&id=' . $object->id; - print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); + print_barre_liste($langs->trans('PriceByCustomer'), $page, $_SERVER ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, 'title_accountancy.png'); print '
'; print ''; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 11930b3e009..76824ca0140 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -428,7 +428,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { $option = '&socid=' . GETPOST('socid', 'int') . '&prodid=' . GETPOST('prodid', 'int'); - print_barre_liste($langs->trans('PriceByCustomerLog'), $page, $_SERVEUR ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); + print_barre_liste($langs->trans('PriceByCustomerLog'), $page, $_SERVER ['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords); if (count($prodcustprice->lines) > 0) { @@ -519,7 +519,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { print ''."\n"; - print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVEUR['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, ''); + print_barre_liste($langs->trans('PriceForEachProduct'), $page, $_SERVER['PHP_SELF'], $option, $sortfield, $sortorder, '', count($prodcustprice->lines), $nbtotalofrecords, ''); print ''; print ''; @@ -603,7 +603,7 @@ if (! empty($conf->global->PRODUIT_CUSTOMER_PRICES)) { { $colspan=9; if ($user->rights->produit->supprimer || $user->rights->service->supprimer) $colspan+=1; - print '' . $langs->trans('None') . ''; + print '' . $langs->trans('None') . ''; } print ""; diff --git a/phpstan.neon b/phpstan.neon index aa7d4fbacc2..34dd50fb4bc 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,7 +1,9 @@ parameters: bootstrap: %currentWorkingDirectory%/build/phpstan/bootstrap.php excludes_analyse: + - %currentWorkingDirectory%/htdocs/includes/restler/framework/Luracast/Restler/AutoLoader.php - %currentWorkingDirectory%/htdocs/includes/* + - %currentWorkingDirectory%/htdocs/*/class/api_* autoload_directories: - %currentWorkingDirectory%/htdocs/accountancy/class - %currentWorkingDirectory%/htdocs/adherents/class @@ -16,10 +18,16 @@ parameters: - %currentWorkingDirectory%/htdocs/comm/propal/class - %currentWorkingDirectory%/htdocs/commande/class - %currentWorkingDirectory%/htdocs/compta/bank/class + - %currentWorkingDirectory%/htdocs/compta/cashcontrol/class + - %currentWorkingDirectory%/htdocs/compta/deplacement/class + - %currentWorkingDirectory%/htdocs/compta/facture/class + - %currentWorkingDirectory%/htdocs/compta/localtax/class + - %currentWorkingDirectory%/htdocs/compta/paiement/class - %currentWorkingDirectory%/htdocs/conf - %currentWorkingDirectory%/htdocs/contact/class - %currentWorkingDirectory%/htdocs/contrat/class - %currentWorkingDirectory%/htdocs/core/class + - %currentWorkingDirectory%/htdocs/product/class - %currentWorkingDirectory%/htdocs/societe/class - %currentWorkingDirectory%/htdocs/user/class autoload_files: []