mirror of
https://github.com/nextcloud/server.git
synced 2026-04-22 23:03:00 -04:00
Merge pull request #48162 from nextcloud/bugfix/noid/array-keys
fix(autocomplete): Move known array keys to psalm docs
This commit is contained in:
commit
a0cb795f04
3 changed files with 7 additions and 7 deletions
|
|
@ -109,7 +109,7 @@ class ShareRecipientSorterTest extends TestCase {
|
|||
]
|
||||
];
|
||||
$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 @@ class ShareRecipientSorterTest extends TestCase {
|
|||
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 @@ class ShareRecipientSorterTest extends TestCase {
|
|||
],
|
||||
[
|
||||
#1 – no recipients
|
||||
'context' => ['itemType' => 'files', 'itemId' => 42],
|
||||
'context' => ['itemType' => 'files', 'itemId' => '42'],
|
||||
'accessList' => ['users' => false],
|
||||
'input' => [
|
||||
'users' =>
|
||||
|
|
@ -192,7 +192,7 @@ class ShareRecipientSorterTest extends TestCase {
|
|||
],
|
||||
[
|
||||
#2 – unsupported item type
|
||||
'context' => ['itemType' => 'announcements', 'itemId' => 42],
|
||||
'context' => ['itemType' => 'announcements', 'itemId' => '42'],
|
||||
'accessList' => null, // not needed
|
||||
'input' => [
|
||||
'users' =>
|
||||
|
|
@ -229,7 +229,7 @@ class ShareRecipientSorterTest extends TestCase {
|
|||
],
|
||||
[
|
||||
#3 – no nothing
|
||||
'context' => ['itemType' => 'files', 'itemId' => 42],
|
||||
'context' => ['itemType' => 'files', 'itemId' => '42'],
|
||||
'accessList' => [],
|
||||
'input' => [],
|
||||
'expected' => [],
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ interface IManager {
|
|||
/**
|
||||
* @param array $sorters list of sorter IDs, separated by "|"
|
||||
* @param array $sortArray array representation of OCP\Collaboration\Collaborators\ISearchResult
|
||||
* @param array $context context info of the search, keys: itemType, itemId
|
||||
* @param array{itemType: string, itemId: string, search?: string} $context context info of the search
|
||||
* @since 13.0.0
|
||||
*/
|
||||
public function runSorters(array $sorters, array &$sortArray, array $context);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ interface ISorter {
|
|||
* 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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue