From 5ad045619c0d4010ecf30c1c4fe1e1275e9ab094 Mon Sep 17 00:00:00 2001 From: Côme Chilliet Date: Tue, 28 Mar 2023 11:13:49 +0200 Subject: View needs to return an instance of OC\Files\FileInfo explicitely MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Applications are calling methods from the class which are not from the public interface, and which cannot be added easily to public interface because Node interface extends FileInfo. Signed-off-by: Côme Chilliet --- lib/private/Files/FileInfo.php | 4 +--- lib/private/Files/View.php | 7 ++----- 2 files changed, 3 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 3016080d6f7..d9b773cc2a6 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -235,10 +235,8 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { /** * Return the currently version used for the HMAC in the encryption app - * - * @return int */ - public function getEncryptedVersion() { + public function getEncryptedVersion(): int { return isset($this->data['encryptedVersion']) ? (int) $this->data['encryptedVersion'] : 1; } diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index 8f324a60ad6..e864ddef84d 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -1336,7 +1336,7 @@ class View { * @param string $path * @param bool|string $includeMountPoints true to add mountpoint sizes, * 'ext' to add only ext storage mount point sizes. Defaults to true. - * @return \OCP\Files\FileInfo|false False if file does not exist + * @return \OC\Files\FileInfo|false False if file does not exist */ public function getFileInfo($path, $includeMountPoints = true) { $this->assertPathLength($path); @@ -1790,11 +1790,8 @@ class View { /** * Get a fileinfo object for files that are ignored in the cache (part files) - * - * @param string $path - * @return \OCP\Files\FileInfo */ - private function getPartFileInfo($path) { + private function getPartFileInfo(string $path): \OC\Files\FileInfo { $mount = $this->getMount($path); $storage = $mount->getStorage(); $internalPath = $mount->getInternalPath($this->getAbsolutePath($path)); -- cgit v1.2.3