From b3ae425ad9ec8d2eb6004433ab597040396b900a Mon Sep 17 00:00:00 2001 From: thibdrev Date: Wed, 24 Jan 2024 21:46:46 +0100 Subject: [PATCH 1/2] qual: phpstan for htdocs/compta/tva/card.php htdocs/compta/tva/card.php 175 Property CommonObject::$fk_account (int) does not accept array|string. htdocs/compta/tva/card.php 332 Property CommonObject::$id (int) does not accept null. htdocs/compta/tva/card.php 332 Property CommonObject::$ref (string) does not accept null. --- htdocs/compta/tva/card.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 5ca22da196c..6fdf926a8b9 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -172,7 +172,7 @@ if (empty($reshook)) { if ($action == 'add' && !$cancel) { $error = 0; - $object->fk_account = GETPOST("accountid", 'int'); + $object->fk_account = GETPOSTINT("accountid"); $object->type_payment = GETPOST("type_payment", 'alphanohtml'); $object->num_payment = GETPOST("num_payment", 'alphanohtml'); @@ -329,7 +329,7 @@ if (empty($reshook)) { $object->fetch($id); if ($object->id > 0) { - $object->id = $object->ref = null; + $object->id = $object->ref = 0; $object->paye = 0; if (GETPOST('amount', 'alphanohtml')) { From b9a4a4d8d2c01e1e8dffa5f4921e7c429aff2874 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 26 Jan 2024 02:17:36 +0100 Subject: [PATCH 2/2] Update card.php --- htdocs/compta/tva/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/tva/card.php b/htdocs/compta/tva/card.php index 6fdf926a8b9..695f3ee45bb 100644 --- a/htdocs/compta/tva/card.php +++ b/htdocs/compta/tva/card.php @@ -329,7 +329,8 @@ if (empty($reshook)) { $object->fetch($id); if ($object->id > 0) { - $object->id = $object->ref = 0; + $object->id = 0; + $object->ref = null; $object->paye = 0; if (GETPOST('amount', 'alphanohtml')) {