mirror of
https://github.com/nextcloud/server.git
synced 2026-04-24 07:39:23 -04:00
fix: Prevent PHP warnings when optional CacheEntry attributes are unset
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
This commit is contained in:
parent
258a85d5c7
commit
752523f874
2 changed files with 4 additions and 4 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue