aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Cache
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Files/Cache')
-rw-r--r--lib/private/Files/Cache/Cache.php4
-rw-r--r--lib/private/Files/Cache/CacheQueryBuilder.php6
-rw-r--r--lib/private/Files/Cache/QuerySearchHelper.php7
3 files changed, 6 insertions, 11 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php
index a512bf76ace..0c0b7b2ad41 100644
--- a/lib/private/Files/Cache/Cache.php
+++ b/lib/private/Files/Cache/Cache.php
@@ -170,7 +170,7 @@ class Cache implements ICache {
} elseif (!$data) {
return $data;
} else {
- $data['metadata'] = $metadataQuery?->extractMetadata($data)->asArray() ?? [];
+ $data['metadata'] = $metadataQuery->extractMetadata($data)->asArray();
return self::cacheEntryFromData($data, $this->mimetypeLoader);
}
}
@@ -242,7 +242,7 @@ class Cache implements ICache {
$result->closeCursor();
return array_map(function (array $data) use ($metadataQuery) {
- $data['metadata'] = $metadataQuery?->extractMetadata($data)->asArray() ?? [];
+ $data['metadata'] = $metadataQuery->extractMetadata($data)->asArray();
return self::cacheEntryFromData($data, $this->mimetypeLoader);
}, $files);
}
diff --git a/lib/private/Files/Cache/CacheQueryBuilder.php b/lib/private/Files/Cache/CacheQueryBuilder.php
index 365d28fc8c5..491fb1fd4e1 100644
--- a/lib/private/Files/Cache/CacheQueryBuilder.php
+++ b/lib/private/Files/Cache/CacheQueryBuilder.php
@@ -138,11 +138,11 @@ class CacheQueryBuilder extends QueryBuilder {
/**
* join metadata to current query builder and returns an helper
*
- * @return IMetadataQuery|null NULL if no metadata have never been generated
+ * @return IMetadataQuery
*/
- public function selectMetadata(): ?IMetadataQuery {
+ public function selectMetadata(): IMetadataQuery {
$metadataQuery = $this->filesMetadataManager->getMetadataQuery($this, $this->alias, 'fileid');
- $metadataQuery?->retrieveMetadata();
+ $metadataQuery->retrieveMetadata();
return $metadataQuery;
}
}
diff --git a/lib/private/Files/Cache/QuerySearchHelper.php b/lib/private/Files/Cache/QuerySearchHelper.php
index d8c5e66e129..849135d44f0 100644
--- a/lib/private/Files/Cache/QuerySearchHelper.php
+++ b/lib/private/Files/Cache/QuerySearchHelper.php
@@ -195,12 +195,7 @@ class QuerySearchHelper {
$files = $result->fetchAll();
$rawEntries = array_map(function (array $data) use ($metadataQuery) {
- // migrate to null safe ...
- if ($metadataQuery === null) {
- $data['metadata'] = [];
- } else {
- $data['metadata'] = $metadataQuery->extractMetadata($data)->asArray();
- }
+ $data['metadata'] = $metadataQuery->extractMetadata($data)->asArray();
return Cache::cacheEntryFromData($data, $this->mimetypeLoader);
}, $files);