From d13d931e2a0d60af4321b787362140f8d18c125f Mon Sep 17 00:00:00 2001 From: thibdrev Date: Mon, 29 Jan 2024 17:39:19 +0100 Subject: [PATCH] qual: phpstan for htdocs/expedition/card.php htdocs/expedition/card.php 614 Property CommonObjectLine::$id (int) does not accept array|string. htdocs/expedition/card.php 760 Property CommonObjectLine::$id (int) does not accept array|string. htdocs/expedition/card.php 761 Property ExpeditionLigne::$entrepot_id (int) does not accept array|string. htdocs/expedition/card.php 762 Property ExpeditionLigne::$qty (float) does not accept array|string. htdocs/expedition/card.php 773 Property CommonObjectLine::$id (int) does not accept array|string. htdocs/expedition/card.php 774 Property ExpeditionLigne::$entrepot_id (int) does not accept array|string. htdocs/expedition/card.php 775 Property ExpeditionLigne::$qty (float) does not accept array|string. htdocs/expedition/card.php 791 Property ExpeditionLigne::$entrepot_id (int) does not accept array|string. htdocs/expedition/card.php 792 Property ExpeditionLigne::$qty (float) does not accept array|string. htdocs/expedition/card.php 806 Property CommonObjectLine::$id (int) does not accept array|string. htdocs/expedition/card.php 807 Property ExpeditionLigne::$qty (float) does not accept array|string. htdocs/expedition/card.php 820 Property CommonObjectLine::$id (int) does not accept array|string. htdocs/expedition/card.php 821 Property ExpeditionLigne::$qty (float) does not accept array|string. --- htdocs/expedition/card.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 053424b9e25..decb5ab0cf3 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -83,7 +83,7 @@ if (empty($origin_id)) { $origin_id = GETPOST('object_id', 'int'); // Id of order or propal } $ref = GETPOST('ref', 'alpha'); -$line_id = GETPOST('lineid', 'int') ? GETPOST('lineid', 'int') : ''; +$line_id = GETPOSTINT('lineid'); $facid = GETPOST('facid', 'int'); $action = GETPOST('action', 'alpha'); @@ -771,8 +771,8 @@ if (empty($reshook)) { $stockLocation = "entl".$line_id; $qty = "qtyl".$line_id; $line->id = $line_id; - $line->entrepot_id = GETPOST($stockLocation, 'int'); - $line->qty = GETPOST($qty, 'int'); + $line->entrepot_id = GETPOSTINT($stockLocation); + $line->qty = GETPOSTFLOAT($qty); if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -785,11 +785,11 @@ if (empty($reshook)) { if (!$error) { $stockLocation = "entl".$detail_entrepot->line_id; $qty = "qtyl".$detail_entrepot->line_id; - $warehouse = GETPOST($stockLocation, 'int'); + $warehouse = GETPOSTINT($stockLocation); if (!empty($warehouse)) { $line->id = $detail_entrepot->line_id; $line->entrepot_id = $warehouse; - $line->qty = GETPOST($qty, 'int'); + $line->qty = GETPOSTFLOAT($qty); if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); $error++; @@ -804,7 +804,7 @@ if (empty($reshook)) { } elseif (!isModEnabled('stock') && empty($conf->productbatch->enabled)) { // both product batch and stock are not activated. $qty = "qtyl".$line_id; $line->id = $line_id; - $line->qty = GETPOST($qty, 'int'); + $line->qty = GETPOSTFLOAT($qty); $line->entrepot_id = 0; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors'); @@ -818,7 +818,7 @@ if (empty($reshook)) { // Product no predefined $qty = "qtyl".$line_id; $line->id = $line_id; - $line->qty = GETPOST($qty, 'int'); + $line->qty = GETPOSTFLOAT($qty); $line->entrepot_id = 0; if ($line->update($user) < 0) { setEventMessages($line->error, $line->errors, 'errors');