Skip to content

Commit 9c04c07

Browse files
committed
fix: Prevent PHP warnings when optional CacheEntry attributes are unset
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
1 parent 5b37d6d commit 9c04c07

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/private/Files/Cache/Cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public function getNumericStorageId() {
149149
* get the stored metadata of a file or folder
150150
*
151151
* @param string | int $file either the path of a file or folder or the file id for a file or folder
152-
* @return ICacheEntry|false the cache entry as array of false if the file is not found in the cache
152+
* @return ICacheEntry|false the cache entry as array or false if the file is not found in the cache
153153
*/
154154
public function get($file) {
155155
$query = $this->getQueryBuilder();

lib/private/Files/Cache/CacheEntry.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,15 @@ public function isEncrypted() {
114114
}
115115

116116
public function getMetadataEtag(): ?string {
117-
return $this->data['metadata_etag'];
117+
return $this->data['metadata_etag'] ?? null;
118118
}
119119

120120
public function getCreationTime(): ?int {
121-
return $this->data['creation_time'];
121+
return $this->data['creation_time'] ?? null;
122122
}
123123

124124
public function getUploadTime(): ?int {
125-
return $this->data['upload_time'];
125+
return $this->data['upload_time'] ?? null;
126126
}
127127

128128
public function getData() {

0 commit comments

Comments
 (0)