Skip to content

Commit 2547d2a

Browse files
authoredNov 1, 2021
Merge pull request #28385 from nextcloud/search-handle-wrapper-filtered-entries
2 parents 63d3931 + 118c647 commit 2547d2a

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed
 

‎build/psalm-baseline.xml

-3
Original file line numberDiff line numberDiff line change
@@ -3509,9 +3509,6 @@
35093509
<code>string</code>
35103510
<code>string</code>
35113511
</InvalidReturnType>
3512-
<NullableReturnStatement occurrences="1">
3513-
<code>$this-&gt;view-&gt;hash($type, $this-&gt;path, $raw)</code>
3514-
</NullableReturnStatement>
35153512
<UndefinedThisPropertyAssignment occurrences="1">
35163513
<code>$this-&gt;exists</code>
35173514
</UndefinedThisPropertyAssignment>

‎lib/private/Files/Cache/Wrapper/CacheJail.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEnt
328328
if ($rawEntry) {
329329
$jailedPath = $this->getJailedPath($rawEntry->getPath());
330330
if ($jailedPath !== null) {
331-
return $this->formatCacheEntry(clone $rawEntry);
331+
return $this->formatCacheEntry(clone $rawEntry) ?: null;
332332
}
333333
}
334334

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

+3-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ protected function getCache() {
6060
* Make it easy for wrappers to modify every returned cache entry
6161
*
6262
* @param ICacheEntry $entry
63-
* @return ICacheEntry
63+
* @return ICacheEntry|false
6464
*/
6565
protected function formatCacheEntry($entry) {
6666
return $entry;
@@ -311,7 +311,8 @@ public function getQueryFilterForStorage(): ISearchOperator {
311311
public function getCacheEntryFromSearchResult(ICacheEntry $rawEntry): ?ICacheEntry {
312312
$rawEntry = $this->getCache()->getCacheEntryFromSearchResult($rawEntry);
313313
if ($rawEntry) {
314-
return $this->formatCacheEntry(clone $rawEntry);
314+
$entry = $this->formatCacheEntry(clone $rawEntry);
315+
return $entry ?: null;
315316
}
316317

317318
return null;

0 commit comments

Comments
 (0)