From bd1abf66e47689f311aabea0a1fc0e8cf705d8aa Mon Sep 17 00:00:00 2001 From: MDW Date: Thu, 21 May 2026 21:54:31 +0200 Subject: [PATCH] qual: Update return type annotations in Projects::getRoles() (#38338) The return type annotations for the method Projects::getRoles() have been updated from array to list to better reflect the actual return type. This change was also reflected in the phpstan-baseline.neon file to maintain consistency. --- dev/build/phpstan/phpstan-baseline.neon | 6 ------ htdocs/projet/class/api_projects.class.php | 6 +++--- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 17f6045abc2..1b323ca0081 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -7104,12 +7104,6 @@ parameters: count: 1 path: ../../../htdocs/projet/card.php - - - message: '#^Method Projects\:\:getRoles\(\) should return array\ but returns list\\.$#' - identifier: return.type - count: 1 - path: ../../../htdocs/projet/class/api_projects.class.php - - message: '#^Call to function method_exists\(\) with \$this\(Project\) and ''getLibStatut'' will always evaluate to true\.$#' identifier: function.alreadyNarrowedType diff --git a/htdocs/projet/class/api_projects.class.php b/htdocs/projet/class/api_projects.class.php index ae6c1f4218d..c89e79da15b 100644 --- a/htdocs/projet/class/api_projects.class.php +++ b/htdocs/projet/class/api_projects.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2016 Laurent Destailleur - * Copyright (C) 2024-2025 MDW + * Copyright (C) 2024-2026 MDW * Copyright (C) 2025 Charlene Benke * Copyright (C) 2025 Frédéric France * Copyright (C) 2025 Jessica Kowal @@ -529,8 +529,8 @@ class Projects extends DolibarrApi * @param int $id Id of project * @param int $userid Id of user (0 = connected user) * @return array - * @phan-return Object[] - * @phpstan-return Object[] + * @phan-return string[] + * @phpstan-return string[] * * @url GET {id}/roles */