From b4bf92018ec6f87d4269df6843c8b89877bc1fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 12 Dec 2024 20:46:16 +0100 Subject: [PATCH] fix phpstan --- build/phpstan/phpstan-baseline.neon | 12 ------------ htdocs/core/tpl/objectline_view.tpl.php | 4 ++-- htdocs/cron/class/cronjob.class.php | 4 ++-- 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/build/phpstan/phpstan-baseline.neon b/build/phpstan/phpstan-baseline.neon index b436d3ce5d3..d64771c69b9 100644 --- a/build/phpstan/phpstan-baseline.neon +++ b/build/phpstan/phpstan-baseline.neon @@ -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 diff --git a/htdocs/core/tpl/objectline_view.tpl.php b/htdocs/core/tpl/objectline_view.tpl.php index 1d9e118cee3..9e34f4ba39f 100644 --- a/htdocs/core/tpl/objectline_view.tpl.php +++ b/htdocs/core/tpl/objectline_view.tpl.php @@ -351,8 +351,8 @@ if (!getDolGlobalString('MAIN_OPTIMIZEFORTEXTBROWSER')) { $tooltiponprice .= '
'; $tooltiponpricemultiprice .= '
'; if (!empty($line->special_code)) { - $tooltiponprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialcode($line->special_code); - $tooltiponpricemultiprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialcode($line->special_code); + $tooltiponprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code); + $tooltiponpricemultiprice .= '
'.$langs->trans("SpecialLine").' : '.getLabelSpecialCode($line->special_code); } if ($line->product_type == 9) { $tooltiponprice .= '
'.$langs->trans("SpecialLine").' : '.$langs->trans("GroupingLine"); diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index f7bb85395c8..455002b097a 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -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); }