diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-23 13:00:49 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 13:00:49 -0600 |
commit | eee7e97a6e0b705f2181c88c3aeb00f664ce3e36 (patch) | |
tree | 3d5839d3329bf8a31bbda6973c4bd14c128e4474 /lib/private | |
parent | 9039b71a2302a2c23c137c25c1cd1365a23b4b60 (diff) | |
parent | 88015bc51f2be457f5f49fcb8230784678a5d755 (diff) | |
download | nextcloud-server-eee7e97a6e0b705f2181c88c3aeb00f664ce3e36.tar.gz nextcloud-server-eee7e97a6e0b705f2181c88c3aeb00f664ce3e36.zip |
Merge pull request #4001 from nextcloud/backport-27389
Ensure that FileInfo return values as required by its phpdoc.
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Files/FileInfo.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/private/Files/FileInfo.php b/lib/private/Files/FileInfo.php index 3ad2932e597..8e968ca453d 100644 --- a/lib/private/Files/FileInfo.php +++ b/lib/private/Files/FileInfo.php @@ -148,10 +148,12 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { } /** - * @return int + * Get FileInfo ID or null in case of part file + * + * @return int|null */ public function getId() { - return $this->data['fileid']; + return isset($this->data['fileid']) ? (int) $this->data['fileid'] : null; } /** @@ -193,7 +195,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ public function getSize() { $this->updateEntryfromSubMounts(); - return isset($this->data['size']) ? $this->data['size'] : 0; + return isset($this->data['size']) ? (int) $this->data['size'] : 0; } /** @@ -201,7 +203,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { */ public function getMTime() { $this->updateEntryfromSubMounts(); - return $this->data['mtime']; + return (int) $this->data['mtime']; } /** @@ -224,11 +226,11 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return int */ public function getPermissions() { - $perms = $this->data['permissions']; + $perms = (int) $this->data['permissions']; if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) { $perms = $perms & ~\OCP\Constants::PERMISSION_SHARE; } - return $perms; + return (int) $perms; } /** |