From f6fb61d70352974e6151e5de23e466a925e09143 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 18 Sep 2024 11:40:45 +0200 Subject: [PATCH] fix(autocomplete): Move known array keys to psalm docs Signed-off-by: Joas Schilling [skip ci] --- .../tests/Collaboration/ShareRecipientSorterTest.php | 10 +++++----- lib/public/Collaboration/AutoComplete/ISorter.php | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php b/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php index 733b37811cdc0..f2c019e4a72a1 100644 --- a/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php +++ b/apps/files_sharing/tests/Collaboration/ShareRecipientSorterTest.php @@ -109,7 +109,7 @@ public function testSortNoNodes() { ] ]; $workArray = $originalArray; - $this->sorter->sort($workArray, ['itemType' => 'files', 'itemId' => 404]); + $this->sorter->sort($workArray, ['itemType' => 'files', 'itemId' => '404']); $this->assertEquals($originalArray, $workArray); } @@ -118,7 +118,7 @@ public function sortDataProvider() { return [[ [ #0 – sort properly and otherwise keep existing order - 'context' => ['itemType' => 'files', 'itemId' => 42], + 'context' => ['itemType' => 'files', 'itemId' => '42'], 'accessList' => ['users' => ['celia', 'darius', 'faruk', 'gail'], 'bots' => ['r2-d2']], 'input' => [ 'users' => @@ -155,7 +155,7 @@ public function sortDataProvider() { ], [ #1 – no recipients - 'context' => ['itemType' => 'files', 'itemId' => 42], + 'context' => ['itemType' => 'files', 'itemId' => '42'], 'accessList' => ['users' => false], 'input' => [ 'users' => @@ -192,7 +192,7 @@ public function sortDataProvider() { ], [ #2 – unsupported item type - 'context' => ['itemType' => 'announcements', 'itemId' => 42], + 'context' => ['itemType' => 'announcements', 'itemId' => '42'], 'accessList' => null, // not needed 'input' => [ 'users' => @@ -229,7 +229,7 @@ public function sortDataProvider() { ], [ #3 – no nothing - 'context' => ['itemType' => 'files', 'itemId' => 42], + 'context' => ['itemType' => 'files', 'itemId' => '42'], 'accessList' => [], 'input' => [], 'expected' => [], diff --git a/lib/public/Collaboration/AutoComplete/ISorter.php b/lib/public/Collaboration/AutoComplete/ISorter.php index 772b1f9c6b9b7..4b9f2b72e7c2a 100644 --- a/lib/public/Collaboration/AutoComplete/ISorter.php +++ b/lib/public/Collaboration/AutoComplete/ISorter.php @@ -23,7 +23,7 @@ public function getId(); * executes the sort action * * @param array $sortArray the array to be sorted, provided as reference - * @param array $context carries key 'itemType' and 'itemId' of the source object (e.g. a file) + * @param array{itemType: string, itemId: string, search?: string} $context carries key 'itemType' and 'itemId' of the source object (e.g. a file) * @since 13.0.0 */ public function sort(array &$sortArray, array $context);