From 1ee475fb116ff310a4ba527774c36cd3ff1b3450 Mon Sep 17 00:00:00 2001 From: Oliver Klee <typo3-coding@oliverklee.de> Date: Thu, 9 Jun 2022 13:56:35 +0200 Subject: [PATCH] [TASK] Improve a type annotation in ListUtility Also simplify the code of a caller as detected by static code analysis. Resolves: #97711 Relates: #97705 Releases: main, 11.5 Change-Id: I1323ffe047cc4954a8c031dbb0218739a7d95571 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74959 Tested-by: core-ci <typo3@b13.com> Tested-by: Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch> --- typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php | 2 +- typo3/sysext/core/Classes/Resource/Utility/ListUtility.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php b/typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php index 3643d4adb535..86cc43a099eb 100644 --- a/typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php +++ b/typo3/sysext/backend/Classes/Tree/FileStorageTreeProvider.php @@ -209,7 +209,7 @@ class FileStorageTreeProvider } $items[] = array_merge( - $this->prepareFolderInformation($subFolder, is_string($subFolderName) ? $subFolderName : null), + $this->prepareFolderInformation($subFolder, $subFolderName), [ 'depth' => $currentDepth, 'expanded' => $expanded, diff --git a/typo3/sysext/core/Classes/Resource/Utility/ListUtility.php b/typo3/sysext/core/Classes/Resource/Utility/ListUtility.php index 5f699ed9bdce..b5a6530c6e40 100644 --- a/typo3/sysext/core/Classes/Resource/Utility/ListUtility.php +++ b/typo3/sysext/core/Classes/Resource/Utility/ListUtility.php @@ -28,7 +28,7 @@ class ListUtility * Resolve special folders (by their role) into localised string * * @param Folder[] $folders - * @return array Array of \TYPO3\CMS\Core\Resource\Folder; folder name or role with folder name as keys + * @return array<string, Folder> array with Folders using the Folder name (with our without role) as key */ public static function resolveSpecialFolderNames(array $folders) { -- GitLab