fix phpstan

This commit is contained in:
Frédéric France 2024-12-12 20:46:16 +01:00
parent c7eb63f41f
commit b4bf92018e
No known key found for this signature in database
GPG key ID: CE25B0B7B53B9177
3 changed files with 4 additions and 16 deletions

View file

@ -17394,18 +17394,6 @@ parameters:
count: 4
path: ../../htdocs/cron/class/cronjob.class.php
-
message: '#^Variable \$ExecTimeLimit in empty\(\) always exists and is not falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/cron/class/cronjob.class.php
-
message: '#^Variable \$MemoryLimit in empty\(\) always exists and is always falsy\.$#'
identifier: empty.variable
count: 1
path: ../../htdocs/cron/class/cronjob.class.php
-
message: '#^Ternary operator condition is always true\.$#'
identifier: ternary.alwaysTrue

View file

@ -351,8 +351,8 @@ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$tooltiponprice .= '<br>';
$tooltiponpricemultiprice .= '<br>';
if (!empty($line->special_code)) {
$tooltiponprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialcode($line->special_code);
$tooltiponpricemultiprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialcode($line->special_code);
$tooltiponprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code);
$tooltiponpricemultiprice .= '<br>'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code);
}
if ($line->product_type == 9) {
$tooltiponprice .= '<br>'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine");

View file

@ -1223,7 +1223,7 @@ class Cronjob extends CommonObject
dol_syslog(get_class($this)."::run_jobs jobtype=".$this->jobtype." userlogin=".$userlogin, LOG_DEBUG);
// Increase limit of time. Works only if we are not in safe mode
$ExecTimeLimit = 600;
$ExecTimeLimit = getDolGlobalInt('MAIN_CRON_EXEC_TIME_LIMIT', 600);
if (!empty($ExecTimeLimit)) {
$err = error_reporting();
error_reporting(0); // Disable all errors
@ -1231,7 +1231,7 @@ class Cronjob extends CommonObject
@set_time_limit($ExecTimeLimit); // Need more than 240 on Windows 7/64
error_reporting($err);
}
$MemoryLimit = 0;
$MemoryLimit = getDolGlobalString('MAIN_CRON_EXEC_TIME_LIMIT');
if (!empty($MemoryLimit)) {
@ini_set('memory_limit', $MemoryLimit);
}