qual: Update return type annotations in Projects::getRoles() (#38338)

The return type annotations for the method Projects::getRoles() have been updated from array<object> to list<string> to better reflect the actual return type. This change was also reflected in the phpstan-baseline.neon file to maintain consistency.
This commit is contained in:
MDW 2026-05-21 21:54:31 +02:00 committed by GitHub
parent 0a64b8b47d
commit bd1abf66e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 9 deletions

View file

@ -7104,12 +7104,6 @@ parameters:
count: 1
path: ../../../htdocs/projet/card.php
-
message: '#^Method Projects\:\:getRoles\(\) should return array\<object\> but returns list\<string\>\.$#'
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

View file

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2024-2026 MDW <mdeweerd@users.noreply.github.com>
* Copyright (C) 2025 Charlene Benke <charlene@patas-monkey.com>
* Copyright (C) 2025 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2025 Jessica Kowal <jessicakowal69@gmail.com>
@ -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
*/