fix phpstan (#30914)

* fix phpstan

* fix phpstan

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Frédéric FRANCE 2024-09-13 03:11:43 +02:00 committed by GitHub
parent 3922b855da
commit ef0a3329a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 19 additions and 4 deletions

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2024 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024 Charlene Benke <charlene@patas-monkey.com>
* 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
@ -704,7 +705,7 @@ function build_exportfile($format, $type, $cachedelay, $filename, $filters)
}
if ($result >= 0) {
if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) {
if (dol_move($outputfiletmp, $outputfile, '0', 1, 0, 0)) {
$result = 1;
} else {
$error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;

View File

@ -2567,7 +2567,7 @@ class Ticket extends CommonObject
}
$moreinfo = array('description' => 'File saved by copyFilesForTicket', 'src_object_type' => $this->element, 'src_object_id' => $this->id);
$res = dol_move($filepath[$i], $destfile, 0, 1, 0, 1, $moreinfo);
$res = dol_move($filepath[$i], $destfile, '0', 1, 0, 1, $moreinfo);
if (!$res) {
// Move has failed
$this->error = "Failed to move file ".dirbasename($filepath[$i])." into ".dirbasename($destfile);

View File

@ -1,4 +1,19 @@
<?php
/* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
// BEGIN PHP File wrapper.php used to download rss, logo, shared files - DO NOT MODIFY - It is just a copy of file website/samples/wrapper.php
$websitekey = basename(__DIR__);
@ -172,7 +187,7 @@ if ($rss) {
$result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
if ($result >= 0) {
if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) {
if (dol_move($outputfiletmp, $outputfile, '0', 1, 0, 0)) {
$result = 1;
} else {
$error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;

View File

@ -81,7 +81,6 @@ parameters:
- '#EvalMath::trigger\(\) expects string, int given#'
- '#get_next_value expects string, int given#'
- '#pdf_writeLinkedObjects expects string, int given#'
- '#dol_move expects string, int given#'
- '#expects int, float#'
- '#expects int, array\|string given.#'
- "# (img_picto) expects int<0, 1>, (false|'') given.#"