Fix phpstan

This commit is contained in:
ldestailleur
2025-02-27 13:59:43 +01:00
parent 65a194650b
commit ed9d616c35

View File

@@ -165,13 +165,14 @@ if ($compression == 'zip') {
} }
} }
$ret = dol_compress_dir($fulldirtocompress, $outputdir."/".$file, $compression, $excludefiles, $rootdirinzip); $ret = dol_compress_dir($fulldirtocompress, $outputdir."/".$file, $compression, $excludefiles, $rootdirinzip); // Can modify $errormsg
if ($ret < 0) { if ($ret < 0) {
if ($ret == -2) { if ($ret == -2) {
$langs->load("errors"); $langs->load("errors");
$errormsg = $langs->trans("ErrNoZipEngine"); $errormsg = $langs->trans("ErrNoZipEngine");
} else { } else {
$langs->load("errors"); $langs->load("errors");
// @phpstan-ignore-next-line The $errormsg can have been modified by the dol_compress_dir function.
$errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir).($errormsg ? "\n" . $errormsg : ""); $errormsg = $langs->trans("ErrorFailedToWriteInDir", $outputdir).($errormsg ? "\n" . $errormsg : "");
} }
} }