Skip to content

Commit cbb5ff6

Browse files
authored
Merge pull request #58377 from nextcloud/backport/58285/stable32
[stable32] fix(cache): filter out invalid entries in `OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById`
2 parents 6654942 + 0c8b04e commit cbb5ff6

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

build/psalm-baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3705,12 +3705,6 @@
37053705
<code><![CDATA[$this->cache instanceof Cache]]></code>
37063706
</RedundantCondition>
37073707
</file>
3708-
<file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php">
3709-
<LessSpecificImplementedReturnType>
3710-
<code><![CDATA[array]]></code>
3711-
<code><![CDATA[array]]></code>
3712-
</LessSpecificImplementedReturnType>
3713-
</file>
37143708
<file src="lib/private/Files/Config/MountProviderCollection.php">
37153709
<InvalidOperand>
37163710
<code><![CDATA[$user]]></code>

lib/private/Files/Cache/Wrapper/CacheWrapper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ public function getFolderContents($folder) {
100100
}
101101

102102
/**
103-
* get the metadata of all files stored in $folder
103+
* Get the metadata of all files stored in given folder
104104
*
105105
* @param int $fileId the file id of the folder
106-
* @return array
106+
* @return ICacheEntry[]
107107
*/
108108
public function getFolderContentsById($fileId) {
109109
$results = $this->getCache()->getFolderContentsById($fileId);
110-
return array_map([$this, 'formatCacheEntry'], $results);
110+
return array_filter(array_map($this->formatCacheEntry(...), $results));
111111
}
112112

113113
/**

0 commit comments

Comments
 (0)