diff options
author | Piotr M <mrow4a@yahoo.com> | 2017-03-15 00:59:48 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-03-22 20:03:46 -0600 |
commit | 5c7079f8c67ff1c8153275ff1eb49d04c05fb808 (patch) | |
tree | c048f55bb90ebcdac0616120cc9b8e8fca7942c3 | |
parent | d551b8e6fdacd7659216b1e698b71840b569b525 (diff) | |
download | nextcloud-server-5c7079f8c67ff1c8153275ff1eb49d04c05fb808.tar.gz nextcloud-server-5c7079f8c67ff1c8153275ff1eb49d04c05fb808.zip |
Ensure that FileInfo return values as required by its phpdoc.
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
-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..a0a3b0a782a 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']) ? intval($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']) ? intval($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 intval($this->data['mtime']); } /** @@ -217,7 +219,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { * @return int */ public function getEncryptedVersion() { - return isset($this->data['encryptedVersion']) ? (int) $this->data['encryptedVersion'] : 1; + return isset($this->data['encryptedVersion']) ? intval($this->data['encryptedVersion']) : 1; } /** @@ -228,7 +230,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess { if (\OCP\Util::isSharingDisabledForUser() || ($this->isShared() && !\OC\Share\Share::isResharingAllowed())) { $perms = $perms & ~\OCP\Constants::PERMISSION_SHARE; } - return $perms; + return intval($perms); } /** |