From c3ad6899732ef3bc7fc7bd5e05dc6b4469a458a0 Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Wed, 20 Mar 2024 14:15:02 +0100 Subject: [PATCH 1/2] Fix return method deleteLine (PHPStan warnings --- htdocs/expedition/class/api_shipments.class.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 2eb5f95d05e..505c6f3a5a4 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -410,7 +410,12 @@ class Shipments extends DolibarrApi $updateRes = $this->shipment->deleteLine(DolibarrApiAccess::$user, $lineid); if ($updateRes > 0) { - return $this->get($id); + return array( + 'success' => array( + 'code' => 200, + 'message' => 'line ' .$lineid. ' deleted' + ) + ); } else { throw new RestException(405, $this->shipment->error); } From f54916ee4dc294d17021ef643cc68417df7f6c5c Mon Sep 17 00:00:00 2001 From: Lamrani Abdel Date: Thu, 21 Mar 2024 15:57:57 +0100 Subject: [PATCH 2/2] Fix return type --- htdocs/expedition/class/api_shipments.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/class/api_shipments.class.php b/htdocs/expedition/class/api_shipments.class.php index 505c6f3a5a4..3f3aa064030 100644 --- a/htdocs/expedition/class/api_shipments.class.php +++ b/htdocs/expedition/class/api_shipments.class.php @@ -386,7 +386,7 @@ class Shipments extends DolibarrApi * * @url DELETE {id}/lines/{lineid} * - * @return int + * @return array * * @throws RestException 401 * @throws RestException 404