Skip to content

Commit 64034f8

Browse files
committed
fix(cache): filter out invalid entries in OC\Files\Cache\Wrapper\CacheWrapper::getFolderContentsById
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent b9b96fb commit 64034f8

2 files changed

Lines changed: 3 additions & 9 deletions

File tree

build/psalm-baseline.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1781,12 +1781,6 @@
17811781
<code><![CDATA[$this->cache instanceof Cache]]></code>
17821782
</RedundantCondition>
17831783
</file>
1784-
<file src="lib/private/Files/Cache/Wrapper/CacheWrapper.php">
1785-
<LessSpecificImplementedReturnType>
1786-
<code><![CDATA[array]]></code>
1787-
<code><![CDATA[array]]></code>
1788-
</LessSpecificImplementedReturnType>
1789-
</file>
17901784
<file src="lib/private/Files/Config/MountProviderCollection.php">
17911785
<InvalidOperand>
17921786
<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
@@ -88,14 +88,14 @@ public function getFolderContents($folder) {
8888
}
8989

9090
/**
91-
* get the metadata of all files stored in $folder
91+
* Get the metadata of all files stored in given folder
9292
*
9393
* @param int $fileId the file id of the folder
94-
* @return array
94+
* @return ICacheEntry[]
9595
*/
9696
public function getFolderContentsById($fileId) {
9797
$results = $this->getCache()->getFolderContentsById($fileId);
98-
return array_map([$this, 'formatCacheEntry'], $results);
98+
return array_filter(array_map($this->formatCacheEntry(...), $results));
9999
}
100100

101101
/**

0 commit comments

Comments
 (0)