diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2023-08-16 14:12:40 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-08-17 09:48:53 +0000 |
commit | 752523f874cdb63f8488f90889f650df35eca1ea (patch) | |
tree | 4255dd0193616f917f0d9325000bb71a0338e212 /lib | |
parent | 258a85d5c786bcf7583a8f0797476d4922413e99 (diff) | |
download | nextcloud-server-752523f874cdb63f8488f90889f650df35eca1ea.tar.gz nextcloud-server-752523f874cdb63f8488f90889f650df35eca1ea.zip |
fix: Prevent PHP warnings when optional CacheEntry attributes are unset
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Cache/Cache.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Cache/CacheEntry.php | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Files/Cache/Cache.php b/lib/private/Files/Cache/Cache.php index 76b2fa942cc..949729925b5 100644 --- a/lib/private/Files/Cache/Cache.php +++ b/lib/private/Files/Cache/Cache.php @@ -149,7 +149,7 @@ class Cache implements ICache { * get the stored metadata of a file or folder * * @param string | int $file either the path of a file or folder or the file id for a file or folder - * @return ICacheEntry|false the cache entry as array of false if the file is not found in the cache + * @return ICacheEntry|false the cache entry as array or false if the file is not found in the cache */ public function get($file) { $query = $this->getQueryBuilder(); diff --git a/lib/private/Files/Cache/CacheEntry.php b/lib/private/Files/Cache/CacheEntry.php index 3c93296ff62..ce9df2823c8 100644 --- a/lib/private/Files/Cache/CacheEntry.php +++ b/lib/private/Files/Cache/CacheEntry.php @@ -114,15 +114,15 @@ class CacheEntry implements ICacheEntry { } public function getMetadataEtag(): ?string { - return $this->data['metadata_etag']; + return $this->data['metadata_etag'] ?? null; } public function getCreationTime(): ?int { - return $this->data['creation_time']; + return $this->data['creation_time'] ?? null; } public function getUploadTime(): ?int { - return $this->data['upload_time']; + return $this->data['upload_time'] ?? null; } public function getData() { |