From 09a62365eb19691703be28ee516930fb9b23a82d Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 10:08:12 +0100 Subject: [PATCH 1/3] Fix PhanPluginUnknownFunctionParamType # Fix PhanPluginUnknownFunctionParamType PHPdoc for $object was incorrect. Also updated the return type and the parameter typing for $head in complete_head_from_modules --- htdocs/core/lib/functions.lib.php | 4 ++-- .../lib/eventorganization_conferenceorbooth.lib.php | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index e6edeabe7ac..51a6ffc698a 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -10318,8 +10318,8 @@ function getLanguageCodeFromCountryCode($countrycode) * @param Conf $conf Object conf * @param Translate $langs Object langs * @param object|null $object Object object - * @param array $head Object head - * @param int $h New position to fill + * @param array> $head List of head tabs (updated by this function) + * @param int $h New position to fill (updated by this function) * @param string $type Value for object where objectvalue can be * 'thirdparty' to add a tab in third party view * 'intervention' to add a tab in intervention view diff --git a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php index b0efb0602c5..f4d88699fe1 100644 --- a/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php +++ b/htdocs/eventorganization/lib/eventorganization_conferenceorbooth.lib.php @@ -1,6 +1,7 @@ + * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -114,7 +115,7 @@ function conferenceorboothPrepareHead($object, $with_project = 0) /** * Prepare array of tabs for ConferenceOrBooth Project tab * - * @param $object Project Project + * @param Project $object Project * @return array */ function conferenceorboothProjectPrepareHead($object) @@ -190,7 +191,7 @@ function conferenceorboothProjectPrepareHead($object) * Prepare array of tabs for ConferenceOrBoothAttendees * * @param ConferenceOrBoothAttendee $object ConferenceOrBoothAttendee - * @return array Array of tabs + * @return array> Array of tabs */ function conferenceorboothAttendeePrepareHead($object) { From b02014bf4736b841967cdc85904f7edbd7c86d95 Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 10:16:41 +0100 Subject: [PATCH 2/3] Fix PhanPluginUnknownFunctionParamType # Fix PhanPluginUnknownFunctionParamType PHPdoc for $object was incorrect. Reviewed some of the other typings as well --- htdocs/hrm/lib/hrm_evaluation.lib.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/htdocs/hrm/lib/hrm_evaluation.lib.php b/htdocs/hrm/lib/hrm_evaluation.lib.php index d4b99471087..a84aa3b0a3b 100644 --- a/htdocs/hrm/lib/hrm_evaluation.lib.php +++ b/htdocs/hrm/lib/hrm_evaluation.lib.php @@ -3,6 +3,7 @@ * Copyright (C) 2021 Greg Rastklan * Copyright (C) 2021 Jean-Pascal BOUDET * Copyright (C) 2021 Grégory BLEMAND + * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +29,7 @@ * Prepare array of tabs for Evaluation * * @param Evaluation $object Evaluation - * @return array Array of tabs + * @return array> Array of tabs */ function evaluationPrepareHead($object) { @@ -129,7 +130,7 @@ function GetLegendSkills() } /** - * @param $obj object object need to handle + * @param object $obj Object needed to be represented * @return string */ function getRankOrderResults($obj) @@ -163,8 +164,9 @@ function getRankOrderResults($obj) /** * Grouped rows with same ref in array - * @param array $objects all rows getted by sql - * @return array |int + * + * @param object[] $objects all rows retrieve from sql query + * @return array|int Object by groiup, -1 if error (empty or bad argument) */ function getGroupedEval($objects) { From 73eeb69cc808f164136ee684f1cf0b187cf091ae Mon Sep 17 00:00:00 2001 From: MDW Date: Wed, 13 Mar 2024 10:18:22 +0100 Subject: [PATCH 3/3] Qual: Enable PhanPluginUnknownFunctionParamType (all fixed) --- dev/tools/phan/config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tools/phan/config.php b/dev/tools/phan/config.php index 53dd0aa447b..e094e4028a4 100644 --- a/dev/tools/phan/config.php +++ b/dev/tools/phan/config.php @@ -466,7 +466,7 @@ return [ // 'PhanPluginNoCommentOnFunction', 'PhanPluginUnknownArrayFunctionParamType', // 'PhanPluginDescriptionlessCommentOnPublicProperty', - 'PhanPluginUnknownFunctionParamType', + // 'PhanPluginUnknownFunctionParamType', // Finds certain errors in PHPdoc typing 'PhanTypeSuspiciousStringExpression', 'PhanPluginRedundantAssignment',