diff options
author | Ferdinand Thiessen <opensource@fthiessen.de> | 2024-09-06 12:18:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-06 12:18:30 +0200 |
commit | ba73beaac12714869f4f4c7808e9b610c10ea0f0 (patch) | |
tree | 57bae9877db526ef8472d02e1fb0e7fc292f4577 /lib | |
parent | 141fed839af0987157a35bb5e0f0e0f3a1501c55 (diff) | |
parent | a96406086c7073ec77d9ba39767ebd7670a11269 (diff) | |
download | nextcloud-server-ba73beaac12714869f4f4c7808e9b610c10ea0f0.tar.gz nextcloud-server-ba73beaac12714869f4f4c7808e9b610c10ea0f0.zip |
Merge pull request #47784 from nextcloud/fix/file-info
fix(FileInfo): correctly implement `\ArrayAccess::offsetGet`
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/FileInfo.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index c47b8b1d1a7..0679dc1ae72 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -95,11 +95,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { unset($this->data[$offset]); } - /** - * @return mixed - */ - #[\ReturnTypeWillChange] - public function offsetGet($offset) { + public function offsetGet(mixed $offset): mixed { return match ($offset) { 'type' => $this->getType(), 'etag' => $this->getEtag(), @@ -164,7 +160,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return string */ public function getEtag() { - $this->updateEntryfromSubMounts(); + $this->updateEntryFromSubMounts(); if (count($this->childEtags) > 0) { $combinedEtag = $this->data['etag'] . '::' . implode('::', $this->childEtags); return md5($combinedEtag); @@ -179,7 +175,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ public function getSize($includeMounts = true) { if ($includeMounts) { - $this->updateEntryfromSubMounts(); + $this->updateEntryFromSubMounts(); if ($this->isEncrypted() && isset($this->data['unencrypted_size']) && $this->data['unencrypted_size'] > 0) { return $this->data['unencrypted_size']; @@ -195,7 +191,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return int */ public function getMTime() { - $this->updateEntryfromSubMounts(); + $this->updateEntryFromSubMounts(); return (int)$this->data['mtime']; } @@ -318,7 +314,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { $this->subMounts = $mounts; } - private function updateEntryfromSubMounts(): void { + private function updateEntryFromSubMounts(): void { if ($this->subMountsUsed) { return; } |