Fix ignored phpstan (#31009)

* fix phpstan

* fix phpstan

* fix phpstan
This commit is contained in:
Frédéric FRANCE 2024-09-20 02:19:05 +02:00 committed by GitHub
parent 32a85608f6
commit f6776541b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 8 additions and 7 deletions

View File

@ -100,6 +100,7 @@ if ($action == 'updateMask') {
$module = new $classname($db);
'@phan-var-force ModelePDFContract $module';
/** @var ModelePDFContract $module */
if ($module->write_file($contract, $langs) > 0) {
header("Location: ".DOL_URL_ROOT."/document.php?modulepart=contract&file=SPECIMEN.pdf");
return;

View File

@ -1,5 +1,6 @@
<?php
/* Copyright (C) 2011-2020 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2011-2020 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
*
* 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
@ -484,7 +485,7 @@ if ($action == 'encrypt') {
if ($resupdate) {
$nbupdatedone++;
} else {
setEventMessages($db->lasterror(), '', 'errors');
setEventMessages($db->lasterror(), null, 'errors');
$error++;
break;
}

View File

@ -1763,7 +1763,7 @@ if (!$error && ($massaction == 'increaseholiday' || ($action == 'increaseholiday
$nbdaysholidays = GETPOSTFLOAT('nbdaysholidays'); // May be 1.5
if ($nbdaysholidays <= 0) {
setEventMessages($langs->trans("WrongAmount"), "", 'errors');
setEventMessages($langs->trans("WrongAmount"), null, 'errors');
$error++;
}
@ -1869,7 +1869,7 @@ if (!$error && ($massaction == 'clonetasks' || ($action == 'clonetasks' && $conf
} else {
if ($db->lasterrno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') {
$langs->load("projects");
setEventMessages($langs->trans('NewTaskRefSuggested'), '', 'warnings');
setEventMessages($langs->trans('NewTaskRefSuggested'), null, 'warnings');
$duplicate_code_error = true;
} else {
setEventMessages($clone_task->error, $clone_task->errors, 'errors');

View File

@ -251,7 +251,7 @@ if (empty($reshook)) {
} else {
if (!empty($batch)) {
$error++;
setEventMessages($langs->transnoentities('StockTransferNoBatchForProduct', $prod->getNomUrl()), '', 'errors');
setEventMessages($langs->transnoentities('StockTransferNoBatchForProduct', $prod->getNomUrl()), null, 'errors');
$action = 'editline';
}
}

View File

@ -549,7 +549,7 @@ if (empty($reshook)) {
$action = 'view';
$comefromclone = true;
setEventMessages($langs->trans("ProjectCreatedInDolibarr", $newobject->ref), "", 'mesgs');
setEventMessages($langs->trans("ProjectCreatedInDolibarr", $newobject->ref), null, 'mesgs');
//var_dump($newobject); exit;
}
}

View File

@ -109,7 +109,6 @@ parameters:
- '# ajax_constantonoff expects array, null given.#'
- '# ldap_search expects array\|LDAP#'
- '# ajax_combobox expects array#'
- '# setEventMessages expects array#'
- '# Context::setError\(\) expects array, string#'
- '# Form::formconfirm\(\) expects array#'
- '# FormWebPortal::selectForForms\(\) expects int, array#'