]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix type hints and doc blocks 4001/head
authorJoas Schilling <coding@schilljs.com>
Thu, 23 Mar 2017 16:52:47 +0000 (17:52 +0100)
committerJoas Schilling <coding@schilljs.com>
Thu, 23 Mar 2017 16:52:47 +0000 (17:52 +0100)
Signed-off-by: Joas Schilling <coding@schilljs.com>
lib/private/Files/FileInfo.php
lib/public/Files/FileInfo.php

index a0a3b0a782a139c1306f008642ca5fd76cab2295..8e968ca453de6d35ded05652db05e4a61af1b604 100644 (file)
@@ -150,10 +150,10 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
        /**
         * Get FileInfo ID or null in case of part file
         *
-        * @return int/null
+        * @return int|null
         */
        public function getId() {
-               return isset($this->data['fileid']) ? intval($this->data['fileid']) : null;
+               return isset($this->data['fileid']) ? (int)  $this->data['fileid'] : null;
        }
 
        /**
@@ -195,7 +195,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
         */
        public function getSize() {
                $this->updateEntryfromSubMounts();
-               return isset($this->data['size']) ? intval($this->data['size']) : 0;
+               return isset($this->data['size']) ? (int) $this->data['size'] : 0;
        }
 
        /**
@@ -203,7 +203,7 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
         */
        public function getMTime() {
                $this->updateEntryfromSubMounts();
-               return intval($this->data['mtime']);
+               return (int) $this->data['mtime'];
        }
 
        /**
@@ -219,18 +219,18 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
         * @return int
         */
        public function getEncryptedVersion() {
-               return isset($this->data['encryptedVersion']) ? intval($this->data['encryptedVersion']) : 1;
+               return isset($this->data['encryptedVersion']) ? (int) $this->data['encryptedVersion'] : 1;
        }
 
        /**
         * @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 intval($perms);
+               return (int) $perms;
        }
 
        /**
index 8eeb8df08ce0fe936f0c2ce820128961f3020890..f0f21087bbe3b841da83c64dcf0cf36cf9095204 100644 (file)
@@ -144,7 +144,7 @@ interface FileInfo {
        /**
         * Get the file id of the file or folder
         *
-        * @return int
+        * @return int|null
         * @since 7.0.0
         */
        public function getId();