From 3df2d3543f038deae001d5f5567845b81c46274f Mon Sep 17 00:00:00 2001 From: thibdrev Date: Tue, 30 Jan 2024 22:49:39 +0100 Subject: [PATCH] qual: phpstan for htdocs/cron/class/cronjob.class.php htdocs/cron/class/cronjob.class.php 266 Property Cronjob::$frequency (int) does not accept string. htdocs/cron/class/cronjob.class.php 269 Property Cronjob::$status (int) does not accept string. htdocs/cron/class/cronjob.class.php 713 Property Cronjob::$frequency (int) does not accept string. htdocs/cron/class/cronjob.class.php 716 Property Cronjob::$status (int) does not accept string. htdocs/cron/class/cronjob.class.php 722 Property Cronjob::$nbrun (int) does not accept string. htdocs/cron/class/cronjob.class.php 948 Property CommonObject::$ref (string) does not accept int. htdocs/cron/class/cronjob.class.php 970 Property Cronjob::$frequency (int) does not accept string. htdocs/cron/class/cronjob.class.php 978 Property Cronjob::$nbrun (int) does not accept string. htdocs/cron/class/cronjob.class.php 1232 Property Cronjob::$lastresult (string) does not accept int. htdocs/cron/class/cronjob.class.php 1248 Property Cronjob::$lastresult (string) does not accept int. htdocs/cron/class/cronjob.class.php 1260 Property Cronjob::$lastresult (string) does not accept int. htdocs/cron/class/cronjob.class.php 1268 Property Cronjob::$lastresult (string) does not accept int. htdocs/cron/class/cronjob.class.php 1283 Property Cronjob::$lastresult (string) does not accept int. --- htdocs/cron/class/cronjob.class.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/htdocs/cron/class/cronjob.class.php b/htdocs/cron/class/cronjob.class.php index 8a57372927b..9c57f274779 100644 --- a/htdocs/cron/class/cronjob.class.php +++ b/htdocs/cron/class/cronjob.class.php @@ -110,7 +110,7 @@ class Cronjob extends CommonObject public $datelastresult = ''; /** - * @var string Last result from end job execution + * @var int Last result from end job execution */ public $lastresult; @@ -263,10 +263,10 @@ class Cronjob extends CommonObject $this->unitfrequency = trim($this->unitfrequency); } if (isset($this->frequency)) { - $this->frequency = trim($this->frequency); + $this->frequency = (int) $this->frequency; } if (isset($this->status)) { - $this->status = trim($this->status); + $this->status = (int) $this->status; } if (isset($this->note_private)) { $this->note_private = trim($this->note_private); @@ -710,10 +710,10 @@ class Cronjob extends CommonObject $this->unitfrequency = trim($this->unitfrequency); } if (isset($this->frequency)) { - $this->frequency = trim($this->frequency); + $this->frequency = (int) $this->frequency; } if (isset($this->status)) { - $this->status = trim($this->status); + $this->status = (int) $this->status; } if (isset($this->note_private)) { $this->note_private = trim($this->note_private); @@ -945,7 +945,7 @@ class Cronjob extends CommonObject public function initAsSpecimen() { $this->id = 0; - $this->ref = 0; + $this->ref = ''; $this->entity = 0; $this->tms = ''; $this->datec = ''; @@ -967,7 +967,7 @@ class Cronjob extends CommonObject $this->lastoutput = ''; $this->lastresult = ''; $this->unitfrequency = ''; - $this->frequency = ''; + $this->frequency = 0; $this->status = 0; $this->processing = 0; $this->pid = null; @@ -975,7 +975,7 @@ class Cronjob extends CommonObject $this->fk_user_author = 0; $this->fk_user_mod = 0; $this->note_private = ''; - $this->nbrun = ''; + $this->nbrun = 0; $this->maxrun = 100; $this->libname = ''; }