Fix phpstan (#35828)

* clean phpstan baseline

* clean baseline

* clean baseline

* clean baseline

* clean baseline
This commit is contained in:
Frédéric FRANCE 2025-10-18 19:09:52 +02:00 committed by GitHub
parent dabda44e8d
commit 05e6c8ce11
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 23 additions and 87 deletions

View file

@ -1410,12 +1410,6 @@ parameters:
count: 1
path: ../../../htdocs/asset/tpl/depreciation_options_edit.tpl.php
-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/asset/tpl/depreciation_options_view.tpl.php
-
message: '#^Variable \$parameters might not be defined\.$#'
identifier: variable.undefined
@ -4032,12 +4026,6 @@ parameters:
count: 1
path: ../../../htdocs/compta/tva/clients.php
-
message: '#^Variable \$description might not be defined\.$#'
identifier: variable.undefined
count: 8
path: ../../../htdocs/compta/tva/clients.php
-
message: '#^Strict comparison using \=\=\= between true and true will always evaluate to true\.$#'
identifier: identical.alwaysTrue
@ -8658,42 +8646,18 @@ parameters:
count: 1
path: ../../../htdocs/core/tpl/extrafields_list_array_fields.tpl.php
-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
-
message: '#^Variable \$i might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
-
message: '#^Variable \$obj might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
-
message: '#^Variable \$totalarray might not be defined\.$#'
identifier: variable.undefined
count: 2
path: ../../../htdocs/core/tpl/extrafields_list_print_fields.tpl.php
-
message: '#^Variable \$db might not be defined\.$#'
identifier: variable.undefined
count: 8
path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php
-
message: '#^Variable \$sql might not be defined\.$#'
identifier: variable.undefined
count: 7
path: ../../../htdocs/core/tpl/extrafields_list_search_sql.tpl.php
-
message: '#^Variable \$param might not be defined\.$#'
identifier: variable.undefined
@ -8712,36 +8676,6 @@ parameters:
count: 1
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$action might not be defined\.$#'
identifier: variable.undefined
count: 6
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$ecmdir might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$filepathnoext might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$module in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$pageid might not be defined\.$#'
identifier: variable.undefined
count: 1
path: ../../../htdocs/core/tpl/filemanager.tpl.php
-
message: '#^Variable \$websitekey might not be defined\.$#'
identifier: variable.undefined
@ -8814,18 +8748,6 @@ parameters:
count: 2
path: ../../../htdocs/core/tpl/objectline_view.tpl.php
-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined
count: 4
path: ../../../htdocs/core/tpl/objectlinked_lineimport.tpl.php
-
message: '#^Variable \$object might not be defined\.$#'
identifier: variable.undefined
count: 3
path: ../../../htdocs/core/tpl/objectlinked_lineimport.tpl.php
-
message: '#^Variable \$langs might not be defined\.$#'
identifier: variable.undefined

View file

@ -27,6 +27,7 @@
*/
/**
* @var DoliDB $db
* @var Form $form
* @var HookManager $hookmanager
* @var AssetDepreciationOptions $assetdepreciationoptions

View file

@ -155,6 +155,7 @@ $period = $form->selectDate($date_start, 'date_start', 0, 0, 0, '', 1, 0).' - '.
$builddate = dol_now();
$description = '';
if (getDolGlobalString('TAX_MODE_SELL_PRODUCT') == 'invoice') {
$description = $langs->trans("RulesVATDueProducts");
}

View file

@ -20,6 +20,8 @@
/**
* @var Conf $conf
* @var CommonObject $object
* @var stdClass $obj
* @var DoliDB $db
* @var ExtraFields $extrafields
*
* @var string $extrafieldsobjectkey
@ -27,6 +29,7 @@
'
@phan-var-force CommonObject $object
@phan-var-force stdClass $obj
';
// Protection to avoid direct call of template

View file

@ -24,7 +24,9 @@
/**
* @var Conf $conf
* @var CommonObject $object
* @var DoliDB $db
* @var ExtraFields $extrafields
* @var string $sql
*/
// Protection to avoid direct call of template

View file

@ -23,13 +23,19 @@
/**
* @var Conf $conf
* @var DoliDB $db
* @var EcmDirectory $ecmdir
* @var Form $form
* @var HookManager $hookmanager
* @var Translate $langs
* @var User $user
* @var Website $website
*
* @var string $module
* @var string $action
* @var ?string $module
* @var int $section
* @var string $filepathnoext
* @var string $pageid
* @var int $formalreadyopen
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
@ -42,6 +48,7 @@ if (empty($conf) || !is_object($conf)) {
@phan-var-force string $filepathnoext
@phan-var-force string $pageid
@phan-var-force EcmDirectory $ecmdir
@phan-var-force ?string $module
@phan-var-force int $section
';
@ -56,7 +63,7 @@ require_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmdirectory.class.php';
$langs->load("ecm");
if (empty($module)) {
if (!isset($module)) {
$module = 'ecm';
}

View file

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2011-2013 Regis Houssin <regis.houssin@inodbox.com>
/* Copyright (C) 2011-2013 Regis Houssin <regis.houssin@inodbox.com>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
@ -15,6 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/**
* @var Conf $conf
* @var CommonObject $object
* @var Translate $langs
*/
// Protection to avoid direct call of template
if (empty($conf) || !is_object($conf)) {
@ -24,7 +29,7 @@ if (empty($conf) || !is_object($conf)) {
$objectUrl = $object->getNomUrl(0, '', '0', 1);
if ($object->element == 'propal') {
$objectUrl = DOL_URL_ROOT.'/comm/propal/card.php?id='.$object->id;
$objectUrl = dolBuildUrl(DOL_URL_ROOT.'/comm/propal/card.php', ['id' => $object->id]);
}
?>
@ -94,12 +99,7 @@ $(document).ready(function(){
{
$.jnotify("<?php echo $langs->trans('ErrorNoUrl'); ?>", "error", true);
}
});
});
</script>