Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
View needs to return an instance of OC\Files\FileInfo explicitely
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 <[email protected]>
  • Loading branch information
come-nc committed Apr 3, 2023
commit 5ad045619c0d4010ecf30c1c4fe1e1275e9ab094
4 changes: 1 addition & 3 deletions lib/private/Files/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,8 @@ public function isEncrypted() {

/**
* 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;
}

Expand Down
7 changes: 2 additions & 5 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -1336,7 +1336,7 @@ private function getCacheEntry($storage, $internalPath, $relativePath) {
* @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);
Expand Down Expand Up @@ -1790,11 +1790,8 @@ private function targetIsNotShared(IStorage $targetStorage, string $targetIntern

/**
* 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));
Expand Down