From aa8e6e123220f40c8ae26e0477d5f018167e884c Mon Sep 17 00:00:00 2001 From: thibdrev Date: Wed, 31 Jan 2024 22:37:40 +0100 Subject: [PATCH] qual: phpstan for htdocs/ticket/class/ticket.class.php htdocs/ticket/class/ticket.class.php 192 Property Ticket::$datec (int) does not accept default value of type string. htdocs/ticket/class/ticket.class.php 197 Property Ticket::$tms (int) does not accept default value of type string. htdocs/ticket/class/ticket.class.php 202 Property Ticket::$date_read (int) does not accept default value of type string. htdocs/ticket/class/ticket.class.php 207 Property Ticket::$date_last_msg_sent (int) does not accept default value of type string. htdocs/ticket/class/ticket.class.php 212 Property Ticket::$date_close (int) does not accept default value of type string. htdocs/ticket/class/ticket.class.php 272 PHPDoc type array of property Ticket::$lines is not covariant with PHPDoc type array of overridden property CommonObject::$lines. htdocs/ticket/class/ticket.class.php 449 Property Ticket::$progress (int) does not accept string. htdocs/ticket/class/ticket.class.php 1007 Property Ticket::$progress (int) does not accept string. htdocs/ticket/class/ticket.class.php 1249 Property Ticket::$progress (int) does not accept string. htdocs/ticket/class/ticket.class.php 1254 Property Ticket::$datec (int) does not accept string. htdocs/ticket/class/ticket.class.php 1255 Property Ticket::$date_read (int) does not accept string. htdocs/ticket/class/ticket.class.php 1256 Property Ticket::$date_last_msg_sent (int) does not accept string. htdocs/ticket/class/ticket.class.php 1257 Property Ticket::$date_close (int) does not accept string. htdocs/ticket/class/ticket.class.php 1258 Property Ticket::$tms (int) does not accept string. --- htdocs/ticket/class/ticket.class.php | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php index b4497bda8dd..b17e0f26286 100644 --- a/htdocs/ticket/class/ticket.class.php +++ b/htdocs/ticket/class/ticket.class.php @@ -189,27 +189,27 @@ class Ticket extends CommonObject /** * @var int Creation date */ - public $datec = ''; + public $datec; /** * @var int Last modification date */ - public $tms = ''; + public $tms; /** * @var int Read date */ - public $date_read = ''; + public $date_read; /** * @var int Last message date */ - public $date_last_msg_sent = ''; + public $date_last_msg_sent; /** * @var int Close ticket date */ - public $date_close = ''; + public $date_close; /** * @var array cache_types_tickets @@ -446,7 +446,7 @@ class Ticket extends CommonObject } if (isset($this->progress)) { - $this->progress = trim($this->progress); + $this->progress = (int) $this->progress; } if (isset($this->timing)) { @@ -1004,7 +1004,7 @@ class Ticket extends CommonObject } if (isset($this->progress)) { - $this->progress = trim($this->progress); + $this->progress = (int) $this->progress; } if (isset($this->timing)) { @@ -1246,16 +1246,16 @@ class Ticket extends CommonObject $this->message = 'Message of ticket'; $this->status = 0; $this->resolution = '1'; - $this->progress = '10'; + $this->progress = 10; //$this->timing = '30'; $this->type_code = 'TYPECODE'; $this->category_code = 'CATEGORYCODE'; $this->severity_code = 'SEVERITYCODE'; - $this->datec = ''; - $this->date_read = ''; - $this->date_last_msg_sent = ''; - $this->date_close = ''; - $this->tms = ''; + $this->datec = dol_now(); + $this->date_read = dol_now(); + $this->date_last_msg_sent = dol_now(); + $this->date_close = dol_now(); + $this->tms = dol_now(); return 1; }