Skip to content

Commit

Permalink
Qual: fix phpstan notices after fixing phan notices
Browse files Browse the repository at this point in the history
  • Loading branch information
mdeweerd committed Feb 5, 2025
1 parent 4eeb0bd commit 2e30ae5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
5 changes: 1 addition & 4 deletions dev/tools/phan/baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
return [
// # Issue statistics:
// PhanTypeMismatchArgument : 3560+ occurrences
// PhanTypeMismatchArgument : 3540+ occurrences
// PhanUndeclaredProperty : 530+ occurrences
// PhanTypeMismatchArgumentNullable : 450+ occurrences
// PhanUndeclaredGlobalVariable : 190+ occurrences
Expand Down Expand Up @@ -97,7 +97,6 @@ return [
'htdocs/admin/bank.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/barcode.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/bom.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/boxes.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/chequereceipts.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/company.php' => ['PhanTypeMismatchArgument'],
'htdocs/admin/contract.php' => ['PhanTypeMismatchArgument'],
Expand Down Expand Up @@ -349,8 +348,6 @@ return [
'htdocs/core/ajax/loadinplace.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/ajax/saveinplace.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/ajax/selectobject.php' => ['PhanTypeMismatchArgumentNullable'],
'htdocs/core/boxes/box_produits.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/boxes/box_produits_alerte_stock.php' => ['PhanTypeMismatchArgument'],
'htdocs/core/class/CMailFile.class.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchArgumentNullable'],
'htdocs/core/class/canvas.class.php' => ['PhanParamTooMany', 'PhanUndeclaredMethod'],
'htdocs/core/class/ccountry.class.php' => ['PhanTypeMismatchArgument', 'PhanUndeclaredProperty'],
Expand Down
4 changes: 2 additions & 2 deletions htdocs/admin/boxes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2004-2022 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2015 Jean-François Ferry <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
* Copyright (C) 2024 Frédéric France <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -471,7 +471,7 @@
print '</table>';
print '</div>';

print $form->buttonsSaveCancel("Save", '', array(), 0, 'reposition');
print $form->buttonsSaveCancel("Save", '', array(), false, 'reposition');

print '</form>';
print "\n".'<!-- End Other Const -->'."\n";
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/boxes/box_produits.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Copyright (C) 2004-2011 Laurent Destailleur <[email protected]>
* Copyright (C) 2005-2012 Regis Houssin <[email protected]>
* Copyright (C) 2015-2023 Frederic France <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -52,7 +52,7 @@ public function __construct($db, $param)
$this->db = $db;

$listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL'));
$tmpentry = array('enabled' => (isModEnabled("product") || isModEnabled("service")), 'perms' => ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service');
$tmpentry = array('enabled' => (int) (isModEnabled("product") || isModEnabled("service")), 'perms' => (string) (int) ($user->hasRight('produit', 'lire') || $user->hasRight('service', 'lire')), 'module' => 'product|service');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
$this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create';
Expand Down Expand Up @@ -167,7 +167,7 @@ public function loadBox($max = 5)
$price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc);
} else {
//Parse the dynamic price
$productstatic->fetch($objp->rowid, '', '', 1);
$productstatic->fetch($objp->rowid, '', '', '1');

require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$priceparser = new PriceParser($this->db);
Expand Down
6 changes: 3 additions & 3 deletions htdocs/core/boxes/box_produits_alerte_stock.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (C) 2005-2012 Maxime Kohlhaas <[email protected]>
* Copyright (C) 2015-2021 Frédéric France <[email protected]>
* Copyright (C) 2015 Juanjo Menent <[email protected]>
* Copyright (C) 2024 MDW <[email protected]>
* Copyright (C) 2024-2025 MDW <[email protected]>
*
* 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
Expand Down Expand Up @@ -54,7 +54,7 @@ public function __construct($db, $param = '')
$this->db = $db;

$listofmodulesforexternal = explode(',', getDolGlobalString('MAIN_MODULES_FOR_EXTERNAL'));
$tmpentry = array('enabled' => ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock');
$tmpentry = array('enabled' => (int) ((isModEnabled("product") || isModEnabled("service")) && isModEnabled('stock')), 'perms' => (string) (int) $user->hasRight('stock', 'lire'), 'module' => 'product|service|stock');
$showmode = isVisibleToUserType(($user->socid > 0 ? 1 : 0), $tmpentry, $listofmodulesforexternal);
$this->hidden = ($showmode != 1);
$this->urltoaddentry = DOL_URL_ROOT.'/product/card.php?action=create';
Expand Down Expand Up @@ -163,7 +163,7 @@ public function loadBox($max = 5)
$price_base_type = $langs->trans($objp->price_base_type);
$price = ($objp->price_base_type == 'HT') ? price($objp->price) : $price = price($objp->price_ttc);
} else { //Parse the dynamic price
$productstatic->fetch($objp->rowid, '', '', 1);
$productstatic->fetch($objp->rowid, '', '', '1');

require_once DOL_DOCUMENT_ROOT.'/product/dynamic_price/class/price_parser.class.php';
$priceparser = new PriceParser($this->db);
Expand Down

0 comments on commit 2e30ae5

Please sign in to comment.