From c6dfdf87916dff6a1eb5fb3cd4b75d91f7f23d06 Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 12 Feb 2024 02:09:49 +0100 Subject: [PATCH] qual: phpstan for htdocs/intracommreport/class/intracommreport.class.php (#28118) htdocs/intracommreport/class/intracommreport.class.php 193 Method IntracommReport::getXML() should return int|SimpleXMLElement but returns string|false. htdocs/intracommreport/class/intracommreport.class.php 225 Method IntracommReport::getXMLDes() should return int|SimpleXMLElement but returns string|false. htdocs/intracommreport/class/intracommreport.class.php 466 Method IntracommReport::getNextDeclarationNumber() should return string but returns (float|int). --- htdocs/intracommreport/class/intracommreport.class.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/intracommreport/class/intracommreport.class.php b/htdocs/intracommreport/class/intracommreport.class.php index 3d76b5034d2..9f689743e2a 100644 --- a/htdocs/intracommreport/class/intracommreport.class.php +++ b/htdocs/intracommreport/class/intracommreport.class.php @@ -141,7 +141,7 @@ class IntracommReport extends CommonObject * @param string $mode 'O' for create, R for regenerate (Look always 0 meant toujours 0 within the framework of XML exchanges according to documentation) * @param string $type Declaration type by default - introduction or expedition (always 'expedition' for Des) * @param string $period_reference Period of reference - * @return SimpleXMLElement|int + * @return string|false|0 Return a well-formed XML string based on SimpleXML element, false or 0 if error */ public function getXML($mode = 'O', $type = 'introduction', $period_reference = '') { @@ -202,7 +202,7 @@ class IntracommReport extends CommonObject * @param int $period_year Year of declaration * @param int $period_month Month of declaration * @param string $type_declaration Declaration type by default - 'introduction' or 'expedition' (always 'expedition' for Des) - * @return SimpleXMLElement|int + * @return string|false|0 Return a well-formed XML string based on SimpleXML element, false or 0 if error */ public function getXMLDes($period_year, $period_month, $type_declaration = 'expedition') { @@ -463,7 +463,7 @@ class IntracommReport extends CommonObject $res = $this->db->fetch_object($resql); } - return ($res->max_declaration_number + 1); + return (string) ($res->max_declaration_number + 1); } /**