Qual: Update phan baseline, set return value for anonymous functions (#35775)

* Qual: Update baseline regarding fixed phan notices

# Qual: Update baseline regarding fixed phan notices

* Qual: Fix phan notice (return type of anonymous function

# Qual: Fix phan notice (return type of anonymous function
This commit is contained in:
MDW
2025-10-17 01:57:37 +02:00
committed by GitHub
parent 174a38b48b
commit fa266e7fd7
2 changed files with 12 additions and 9 deletions

View File

@@ -12,11 +12,11 @@ return [
// PhanUndeclaredProperty : 420+ occurrences
// PhanTypeMismatchProperty : 100+ occurrences
// PhanTypeMismatchArgument : 70+ occurrences
// PhanUndeclaredGlobalVariable : 65+ occurrences
// PhanUndeclaredGlobalVariable : 60+ occurrences
// PhanTypeMismatchArgumentNullable : 40+ occurrences
// PhanTypeInvalidDimOffset : 15+ occurrences
// PhanTypeMismatchDimFetch : 15+ occurrences
// PhanUndeclaredMethod : 9 occurrences
// PhanUndeclaredMethod : 8 occurrences
// PhanPossiblyUndeclaredGlobalVariable : 6 occurrences
// PhanTypeArraySuspiciousNull : 6 occurrences
// PhanTypeComparisonFromArray : 6 occurrences
@@ -31,7 +31,6 @@ return [
// Currently, file_suppressions and directory_suppressions are the only supported suppressions
'file_suppressions' => [
'htdocs/bookcal/class/availabilities.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/bookcal/class/calendar.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/categories/viewcat.php' => ['PhanUndeclaredProperty'],
'htdocs/comm/action/index.php' => ['PhanTypeMismatchArgument', 'PhanTypeMismatchProperty'],
@@ -157,10 +156,7 @@ return [
'htdocs/delivery/class/delivery.class.php' => ['PhanUndeclaredProperty'],
'htdocs/don/admin/donation.php' => ['PhanUndeclaredMethod'],
'htdocs/don/class/don.class.php' => ['PhanParamTooMany'],
'htdocs/don/document.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/info.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/don/list.php' => ['PhanTypeMismatchProperty'],
'htdocs/don/note.php' => ['PhanUndeclaredGlobalVariable'],
'htdocs/emailcollector/class/emailcollector.class.php' => ['PhanUndeclaredProperty'],
'htdocs/eventorganization/class/conferenceorboothattendee.class.php' => ['PhanUndeclaredMethod', 'PhanUndeclaredProperty'],
'htdocs/eventorganization/conferenceorbooth_list.php' => ['PhanTypeMismatchArgument'],
@@ -217,7 +213,7 @@ return [
'htdocs/product/reassort.php' => ['PhanTypeExpectedObjectPropAccessButGotNull'],
'htdocs/product/stock/info.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/list.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredGlobalVariable', 'PhanUndeclaredProperty'],
'htdocs/product/stock/movement_list.php' => ['PhanPluginUndeclaredVariableIsset', 'PhanUndeclaredProperty'],
'htdocs/product/stock/productlot_card.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stats/commande_fournisseur.php' => ['PhanUndeclaredProperty'],
'htdocs/product/stock/stats/expedition.php' => ['PhanUndeclaredProperty'],

View File

@@ -2,6 +2,7 @@
/*
* Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
* Copyright (c) 2025 Schaffhauser sébastien <sebastien@webmaster67.fr>
* Copyright (C) 2025 MDW <mdeweerd@users.noreply.github.com>
* 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
* the Free Software Foundation.
@@ -127,12 +128,18 @@ class SharedDocumentsController extends AbstractDocumentController
// 5. Define functions to build navigation and download links
$linkBuilder = array(
'dir' => /** @param array<string, mixed> $dir */
'dir' => /**
* @param array<string, mixed> $dir
* @return string
*/
function (array $dir) use ($baseUrl, $sanitized_subdir) {
$new_subdir = (!empty($sanitized_subdir) ? $sanitized_subdir . '/' : '') . $dir['name'];
return $baseUrl . '&subdir=' . urlencode($new_subdir);
},
'file' => /** @param array<string, mixed> $file */
'file' => /**
* @param array<string, mixed> $file
* @return string
*/
function (array $file) use ($shared_dir_name, $sanitized_subdir) {
$file_path = $shared_dir_name . '/' . (!empty($sanitized_subdir) ? $sanitized_subdir . '/' : '') . $file['name'];
return DOL_URL_ROOT . '/document.php?modulepart=ecm&file=' . urlencode($file_path);