diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index f7008dad5eb..3d060a80eaa 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -859,7 +859,7 @@ class Categorie extends CommonObject
* @param string $sortorder Sort order ('ASC' or 'DESC');
* @param array $filter Filter array. Example array('field'=>'valueforlike', 'customsql'=>...)
* @param string $filtermode Filter mode (AND or OR)
- * @return array|int -1 if KO, array of instance of object if OK
+ * @return CommonObject[]|int[]|int Return -1 if KO, array of instance of object if OK
* @see containsObject()
*/
public function getObjectsInCateg($type, $onlyids = 0, $limit = 0, $offset = 0, $sortfield = '', $sortorder = 'ASC', $filter = array(), $filtermode = 'AND')
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 13864aa45db..5d1d44738fe 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -499,6 +499,7 @@ if ($type == Categorie::TYPE_PRODUCT) {
if ($prods < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ /** @var Product[] $prods */
// Form to add record into the category
$showclassifyform = 1;
if ($showclassifyform) {
@@ -584,6 +585,7 @@ if ($type == Categorie::TYPE_CUSTOMER) {
if ($socs < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ /** @var Societe[] $socs */
// Form to add record into a category
$showclassifyform = 1;
if ($showclassifyform) {
@@ -668,6 +670,7 @@ if ($type == Categorie::TYPE_SUPPLIER) {
if ($socs < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ /** @var Fournisseur[] $socs */
// Form to add record into a category
$showclassifyform = 1;
if ($showclassifyform) {
@@ -751,10 +754,11 @@ if ($type == Categorie::TYPE_MEMBER) {
$permission = $user->hasRight('adherent', 'creer');
- $prods = $object->getObjectsInCateg($type, 0, $limit, $offset);
- if ($prods < 0) {
+ $members = $object->getObjectsInCateg($type, 0, $limit, $offset);
+ if ($members < 0) {
dol_print_error($db, $object->error, $object->errors);
} else {
+ /** @var Adherent[] $members */
// Form to add record into a category
$showclassifyform = 1;
if ($showclassifyform) {
@@ -784,7 +788,7 @@ if ($type == Categorie::TYPE_MEMBER) {
print '
';
$param = '&limit='.$limit.'&id='.$id.'&type='.$type;
- $num = count($prods);
+ $num = count($members);
$nbtotalofrecords = '';
$newcardbutton = dolGetButtonTitle($langs->trans("AddMember"), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/adherents/card.php?action=create&memcats[]='.$object->id.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $user->hasRight('adherent', 'creer'));
@@ -793,9 +797,9 @@ if ($type == Categorie::TYPE_MEMBER) {
print '
| '.$langs->trans("Name").' |