From 57e9e5f845d26db0d255a1b10bb86bf700d2b9d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?No=C3=A9=20Cendrier?= <81741011+altairis-noe@users.noreply.github.com> Date: Wed, 14 Aug 2024 16:05:24 +0200 Subject: [PATCH] FIX: PHPDoc wrong return value (#30634) * FIX: PHPDoc wrong return value * better type * FIX: there is more types for Categorie::containing() return --- htdocs/categories/class/categorie.class.php | 10 +++++----- htdocs/core/class/commonobject.class.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index b61a561840d..21454dd18fb 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1518,11 +1518,11 @@ class Categorie extends CommonObject * Return list of categories (object instances or labels) linked to element of id $id and type $type * Should be named getListOfCategForObject * - * @param int $id Id of element - * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) - * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category - * labels, 'id'= Get array of category IDs - * @return Categorie[]|int[]|int Array of category objects (slow) or Array of category id or < 0 if KO + * @param int $id Id of element + * @param string|int $type Type of category ('customer', 'supplier', 'contact', 'product', 'member') or (0, 1, 2, ...) + * @param string $mode 'id'=Get array of category ids, 'object'=Get array of fetched category instances, 'label'=Get array of category + * labels, 'id'= Get array of category IDs + * @return Categorie[]|int[]|string[]|int Array of category objects, labels or IDs or < 0 if KO */ public function containing($id, $type, $mode = 'object') { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 29c7a9f6661..eff326c41da 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -10857,7 +10857,7 @@ abstract class CommonObject * Existing categories are left untouch. * * @param string $type_categ Category type ('customer', 'supplier', 'website_page', ...) - * @return int Array of category objects or < 0 if KO + * @return int[]|int Array of category IDs or < 0 if KO */ public function getCategoriesCommon($type_categ) {