]> source.dussan.org Git - nextcloud-server.git/commitdiff
Cleanup of PHPDoc return types
authorRobin McCorkell <rmccorkell@karoshi.org.uk>
Fri, 16 Jan 2015 18:31:15 +0000 (18:31 +0000)
committerRobin McCorkell <rmccorkell@karoshi.org.uk>
Fri, 16 Jan 2015 20:30:43 +0000 (20:30 +0000)
19 files changed:
apps/files_sharing/lib/cache.php
apps/files_sharing/lib/controllers/sharecontroller.php
apps/files_sharing/lib/sharedstorage.php
apps/user_ldap/lib/access.php
apps/user_ldap/lib/wizard.php
apps/user_ldap/user_ldap.php
lib/private/app.php
lib/private/appconfig.php
lib/private/appframework/core/api.php
lib/private/files/cache/cache.php
lib/private/files/cache/wrapper/cachejail.php
lib/private/files/cache/wrapper/cachewrapper.php
lib/private/files/storage/common.php
lib/private/hook.php
lib/private/tags.php
lib/public/files/storage.php
lib/public/iappconfig.php
lib/public/itags.php
lib/public/share_backend.php

index 21f807f35333e74dff2ca6fdc316ba44d251c989..e0737834812440b7365b17d3761c785fcda614aa 100644 (file)
@@ -45,7 +45,7 @@ class Shared_Cache extends Cache {
         * Get the source cache of a shared file or folder
         *
         * @param string $target Shared target file path
-        * @return \OC\Files\Cache\Cache
+        * @return \OC\Files\Cache\Cache|false
         */
        private function getSourceCache($target) {
                if ($target === false || $target === $this->storage->getMountPoint()) {
@@ -82,7 +82,7 @@ class Shared_Cache extends Cache {
         * get the stored metadata of a file or folder
         *
         * @param string|int $file
-        * @return array
+        * @return array|false
         */
        public function get($file) {
                if (is_string($file)) {
@@ -148,7 +148,7 @@ class Shared_Cache extends Cache {
         * get the metadata of all files stored in $folder
         *
         * @param string $folderId
-        * @return array
+        * @return array|false
         */
        public function getFolderContentsById($folderId) {
                $cache = $this->getSourceCache('');
@@ -178,7 +178,7 @@ class Shared_Cache extends Cache {
         * @param string $file
         * @param array $data
         *
-        * @return int file id
+        * @return int|false file id
         */
        public function put($file, array $data) {
                $file = ($file === false) ? '' : $file;
index 69de717611c446f3700569620c089a88b9a83698..3534ba179f134f9e39080e3226a1ef77f4c6b167 100644 (file)
@@ -131,7 +131,7 @@ class ShareController extends Controller {
         *
         * @param string $token
         * @param string $path
-        * @return TemplateResponse
+        * @return TemplateResponse|RedirectResponse
         */
        public function showShare($token, $path = '') {
                \OC_User::setIncognitoMode(true);
index d992f8f70b41923880fe7fc30bf8df59f6af30e5..ccfbebddb294726038ffc960b2dc68fad0a68f08 100644 (file)
@@ -80,7 +80,7 @@ class Shared extends \OC\Files\Storage\Common implements ISharedStorage {
        /**
         * Get the source file path for a shared file
         * @param string $target Shared target file path
-        * @return string source file path or false if not found
+        * @return string|false source file path or false if not found
         */
        public function getSourcePath($target) {
                $source = $this->getFile($target);
index 0fb968cebe7b26dae8941fed7ae7ee3af988caa3..498a3ae923fd9b3bb21525178a2c01bf5650fbd2 100644 (file)
@@ -303,7 +303,7 @@ class Access extends LDAPUtility implements user\IUserTools {
        /**
         * returns the LDAP DN for the given internal ownCloud name of the user
         * @param string $name the ownCloud name in question
-        * @return string with the LDAP DN on success, otherwise false
+        * @return string|false with the LDAP DN on success, otherwise false
         */
        public function username2dn($name) {
                $fdn = $this->userMapper->getDNbyName($name);
@@ -322,7 +322,7 @@ class Access extends LDAPUtility implements user\IUserTools {
         * returns the internal ownCloud name for the given LDAP DN of the group, false on DN outside of search DN or failure
         * @param string $fdn the dn of the group object
         * @param string $ldapName optional, the display name of the object
-        * @return string with the name to use in ownCloud, false on DN outside of search DN
+        * @return string|false with the name to use in ownCloud, false on DN outside of search DN
         */
        public function dn2groupname($fdn, $ldapName = null) {
                //To avoid bypassing the base DN settings under certain circumstances
@@ -339,7 +339,7 @@ class Access extends LDAPUtility implements user\IUserTools {
         * returns the internal ownCloud name for the given LDAP DN of the user, false on DN outside of search DN or failure
         * @param string $dn the dn of the user object
         * @param string $ldapName optional, the display name of the object
-        * @return string with with the name to use in ownCloud
+        * @return string|false with with the name to use in ownCloud
         */
        public function dn2username($fdn, $ldapName = null) {
                //To avoid bypassing the base DN settings under certain circumstances
@@ -357,7 +357,7 @@ class Access extends LDAPUtility implements user\IUserTools {
         * @param string $dn the dn of the user object
         * @param string $ldapName optional, the display name of the object
         * @param bool $isUser optional, whether it is a user object (otherwise group assumed)
-        * @return string with with the name to use in ownCloud
+        * @return string|false with with the name to use in ownCloud
         */
        public function dn2ocname($fdn, $ldapName = null, $isUser = true) {
                if($isUser) {
@@ -508,7 +508,7 @@ class Access extends LDAPUtility implements user\IUserTools {
        /**
         * creates a unique name for internal ownCloud use for users. Don't call it directly.
         * @param string $name the display name of the object
-        * @return string with with the name to use in ownCloud or false if unsuccessful
+        * @return string|false with with the name to use in ownCloud or false if unsuccessful
         *
         * Instead of using this method directly, call
         * createAltInternalOwnCloudName($name, true)
@@ -530,7 +530,7 @@ class Access extends LDAPUtility implements user\IUserTools {
        /**
         * creates a unique name for internal ownCloud use for groups. Don't call it directly.
         * @param string $name the display name of the object
-        * @return string with with the name to use in ownCloud or false if unsuccessful.
+        * @return string|false with with the name to use in ownCloud or false if unsuccessful.
         *
         * Instead of using this method directly, call
         * createAltInternalOwnCloudName($name, false)
@@ -569,7 +569,7 @@ class Access extends LDAPUtility implements user\IUserTools {
         * creates a unique name for internal ownCloud use.
         * @param string $name the display name of the object
         * @param boolean $isUser whether name should be created for a user (true) or a group (false)
-        * @return string with with the name to use in ownCloud or false if unsuccessful
+        * @return string|false with with the name to use in ownCloud or false if unsuccessful
         */
        private function createAltInternalOwnCloudName($name, $isUser) {
                $originalTTL = $this->connection->ldapCacheTTL;
index 2e4507a258527c2808a88146e18ecd4506b7aaa5..ed9188bc880c70863804598facf062c4c5140482 100644 (file)
@@ -110,7 +110,7 @@ class Wizard extends LDAPUtility {
                        return false;
                }
                $groupsTotal = ($groupsTotal !== false) ? $groupsTotal : 0;
-               $output = self::$l->n('%s group found', '%s groups found', $groupsTotal, $groupsTotal);
+               $output = self::$l->n('%s group found', '%s groups found', $groupsTotal, array($groupsTotal));
                $this->result->addChange('ldap_group_count', $output);
                return $this->result;
        }
@@ -124,7 +124,7 @@ class Wizard extends LDAPUtility {
 
                $usersTotal = $this->countEntries($filter, 'users');
                $usersTotal = ($usersTotal !== false) ? $usersTotal : 0;
-               $output = self::$l->n('%s user found', '%s users found', $usersTotal, $usersTotal);
+               $output = self::$l->n('%s user found', '%s users found', $usersTotal, array($usersTotal));
                $this->result->addChange('ldap_user_count', $output);
                return $this->result;
        }
@@ -314,7 +314,7 @@ class Wizard extends LDAPUtility {
 
        /**
         * detects the available LDAP attributes
-        * @return array The instance's WizardResult instance
+        * @return array|false The instance's WizardResult instance
         * @throws \Exception
         */
        private function getUserAttributes() {
@@ -348,7 +348,7 @@ class Wizard extends LDAPUtility {
 
        /**
         * detects the available LDAP groups
-        * @return WizardResult the instance's WizardResult instance
+        * @return WizardResult|false the instance's WizardResult instance
         */
        public function determineGroupsForGroups() {
                return $this->determineGroups('ldap_groupfilter_groups',
@@ -358,7 +358,7 @@ class Wizard extends LDAPUtility {
 
        /**
         * detects the available LDAP groups
-        * @return WizardResult the instance's WizardResult instance
+        * @return WizardResult|false the instance's WizardResult instance
         */
        public function determineGroupsForUsers() {
                return $this->determineGroups('ldap_userfilter_groups',
@@ -370,7 +370,7 @@ class Wizard extends LDAPUtility {
         * @param string $dbKey
         * @param string $confKey
         * @param bool $testMemberOf
-        * @return WizardResult the instance's WizardResult instance
+        * @return WizardResult|false the instance's WizardResult instance
         * @throws \Exception
         */
        private function determineGroups($dbKey, $confKey, $testMemberOf = true) {
@@ -467,7 +467,7 @@ class Wizard extends LDAPUtility {
 
        /**
         * Detects the available object classes
-        * @return WizardResult the instance's WizardResult instance
+        * @return WizardResult|false the instance's WizardResult instance
         * @throws \Exception
         */
        public function determineGroupObjectClasses() {
@@ -524,7 +524,7 @@ class Wizard extends LDAPUtility {
        }
 
        /**
-        * @return WizardResult
+        * @return WizardResult|false
         * @throws \Exception
         */
        public function getGroupFilter() {
@@ -548,7 +548,7 @@ class Wizard extends LDAPUtility {
        }
 
        /**
-        * @return WizardResult
+        * @return WizardResult|false
         * @throws \Exception
         */
        public function getUserListFilter() {
@@ -1146,7 +1146,7 @@ class Wizard extends LDAPUtility {
         * Configuration class
         * @param bool $po whether the objectClass with most result entries
         * shall be pre-selected via the result
-        * @return array, list of found items.
+        * @return array|false list of found items.
         * @throws \Exception
         */
        private function determineFeature($objectclasses, $attr, $dbkey, $confkey, $po = false) {
index 051e760105b13daa79ac5a168924f6cccfc3b911..270e94121d5aab288bee9fa10a8453c219885ad1 100644 (file)
@@ -303,7 +303,7 @@ class USER_LDAP extends BackendUtility implements \OCP\IUserBackend, \OCP\UserIn
        /**
         * get display name of the user
         * @param string $uid user ID of the user
-        * @return string display name
+        * @return string|false display name
         */
        public function getDisplayName($uid) {
                if(!$this->userExists($uid)) {
index e75202eec230f4222dd1d1e3496753d72fffbad3..58625b26388001f788938d3c8b1c5093bc5cb555 100644 (file)
@@ -489,7 +489,7 @@ class OC_App {
        /**
         * Get the path where to install apps
         *
-        * @return string
+        * @return string|false
         */
        public static function getInstallPath() {
                if (OC_Config::getValue('appstoreenabled', true) == false) {
@@ -891,7 +891,7 @@ class OC_App {
 
        /**
         * get a list of all apps on apps.owncloud.com
-        * @return array, multi-dimensional array of apps.
+        * @return array|false multi-dimensional array of apps.
         *     Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description
         */
        public static function getAppstoreApps($filter = 'approved', $category = null) {
@@ -1180,7 +1180,7 @@ class OC_App {
 
        /**
         * @param string $appId
-        * @return \OC\Files\View
+        * @return \OC\Files\View|false
         */
        public static function getStorage($appId) {
                if (OC_App::isEnabled($appId)) { //sanity check
index 1874d9f2b1937358579d622a16875dd68b5f384e..cd27f91bf0187499f4ab70617c8629d551fd711c 100644 (file)
@@ -245,7 +245,7 @@ class AppConfig implements \OCP\IAppConfig {
         *
         * @param string|false $app
         * @param string|false $key
-        * @return array
+        * @return array|false
         */
        public function getValues($app, $key) {
                if (($app !== false) == ($key !== false)) {
index 2f01015bb1583ec9a93718927a47c736ab931735..ab66c54c921a40df121e60984fe2b47de776766d 100644 (file)
@@ -136,7 +136,7 @@ class API implements IApi{
         * @param string $slotName name of slot, in another word, this is the
         *               name of the method that will be called when registered
         *               signal is emitted.
-        * @return bool, always true
+        * @return bool always true
         */
        public function connectHook($signalClass, $signalName, $slotClass, $slotName) {
                return \OCP\Util::connectHook($signalClass, $signalName, $slotClass, $slotName);
@@ -148,7 +148,7 @@ class API implements IApi{
         * @param string $signalClass class name of emitter
         * @param string $signalName name of signal
         * @param array $params default: array() array with additional data
-        * @return bool, true if slots exists or false if not
+        * @return bool true if slots exists or false if not
         */
        public function emitHook($signalClass, $signalName, $params = array()) {
                return  \OCP\Util::emitHook($signalClass, $signalName, $params);
index 8d0681ba9351aa7b2ad9e53b1ee072d2099b8a39..de973f2fd0815b7e94aef63ae088386b4b9ff1e5 100644 (file)
@@ -434,7 +434,7 @@ class Cache {
        /**
         * @param string $file
         *
-        * @return int, Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
+        * @return int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
         */
        public function getStatus($file) {
                // normalize file
@@ -684,7 +684,7 @@ class Cache {
         * instead does a global search in the cache table
         *
         * @param int $id
-        * @return array, first element holding the storage id, second the path
+        * @return array first element holding the storage id, second the path
         */
        static public function getById($id) {
                $sql = 'SELECT `storage`, `path` FROM `*PREFIX*filecache` WHERE `fileid` = ?';
index 3f7ea66ea1b60f50b473d498a3589c0e9936bf52..bb065643cf782d3e9401287d5b9e438cdbd09bb3 100644 (file)
@@ -163,7 +163,7 @@ class CacheJail extends CacheWrapper {
        /**
         * @param string $file
         *
-        * @return int, Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
+        * @return int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
         */
        public function getStatus($file) {
                return $this->cache->getStatus($this->getSourcePath($file));
index 83811520e4bf38f0e29465dff3a0f0b227bf7f01..a5997edb307a8938a4b4208d969945ec84fb29ba 100644 (file)
@@ -152,7 +152,7 @@ class CacheWrapper extends Cache {
        /**
         * @param string $file
         *
-        * @return int, Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
+        * @return int Cache::NOT_FOUND, Cache::PARTIAL, Cache::SHALLOW or Cache::COMPLETE
         */
        public function getStatus($file) {
                return $this->cache->getStatus($file);
@@ -260,7 +260,7 @@ class CacheWrapper extends Cache {
         * instead does a global search in the cache table
         *
         * @param int $id
-        * @return array, first element holding the storage id, second the path
+        * @return array first element holding the storage id, second the path
         */
        static public function getById($id) {
                return parent::getById($id);
index b2bf41f751c84b6af2dd24ba05da0ee9b283519c..9c233e447a693e90091cc57c11a97c76125d88fc 100644 (file)
@@ -343,7 +343,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
         * get the owner of a path
         *
         * @param string $path The path to get the owner
-        * @return string uid or false
+        * @return string|false uid or false
         */
        public function getOwner($path) {
                return \OC_User::getUser();
@@ -353,7 +353,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
         * get the ETag for a file or folder
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function getETag($path) {
                $ETagFunction = \OC_Connector_Sabre_Node::$ETagFunction;
@@ -400,7 +400,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
         * get the free space in the storage
         *
         * @param string $path
-        * @return int
+        * @return int|false
         */
        public function free_space($path) {
                return \OCP\Files\FileInfo::SPACE_UNKNOWN;
@@ -445,7 +445,7 @@ abstract class Common implements \OC\Files\Storage\Storage {
         * For now the returned array can hold the parameter url - in future more attributes might follow.
         *
         * @param string $path
-        * @return array
+        * @return array|false
         */
        public function getDirectDownload($path) {
                return [];
index c9ca58f779e7084ebab1af781d7a3bb6f772d9a0..00fb4cb0ff5d87b8a490753c4255c2ef701ee61f 100644 (file)
@@ -52,7 +52,7 @@ class OC_Hook{
         * @param string $signalclass class name of emitter
         * @param string $signalname name of signal
         * @param mixed $params default: array() array with additional data
-        * @return bool, true if slots exists or false if not
+        * @return bool true if slots exists or false if not
         *
         * Emits a signal. To get data from the slot use references!
         *
index 9ff433b6984eb92ab35bf1c91beb06391c448d7d..affbb639934ef8fd5502a60aaec7e643ae6eaa77 100644 (file)
@@ -247,7 +247,7 @@ class Tags implements \OCP\ITags {
        * Throws an exception if the tag could not be found.
        *
        * @param string $tag Tag id or name.
-       * @return array An array of object ids or false on error.
+       * @return array|false An array of object ids or false on error.
        */
        public function getIdsForTag($tag) {
                $result = null;
@@ -337,7 +337,7 @@ class Tags implements \OCP\ITags {
        * Add a new tag.
        *
        * @param string $name A string with a name of the tag
-       * @return false|string the id of the added tag or false on error.
+       * @return false|int the id of the added tag or false on error.
        */
        public function add($name) {
                $name = trim($name);
@@ -575,7 +575,7 @@ class Tags implements \OCP\ITags {
        /**
        * Get favorites for an object type
        *
-       * @return array An array of object ids.
+       * @return array|false An array of object ids.
        */
        public function getFavorites() {
                try {
index 36d5b800df6aaceca4bcb2d0dfefd00824b5ed4c..3e6559c28f7354f233286aceba44f65d9af967ae 100644 (file)
@@ -72,7 +72,7 @@ interface Storage {
         * see http://php.net/manual/en/function.opendir.php
         *
         * @param string $path
-        * @return resource
+        * @return resource|false
         */
        public function opendir($path);
 
@@ -97,7 +97,7 @@ interface Storage {
         * only the following keys are required in the result: size and mtime
         *
         * @param string $path
-        * @return array
+        * @return array|false
         */
        public function stat($path);
 
@@ -105,7 +105,7 @@ interface Storage {
         * see http://php.net/manual/en/function.filetype.php
         *
         * @param string $path
-        * @return bool
+        * @return string|false
         */
        public function filetype($path);
 
@@ -114,7 +114,7 @@ interface Storage {
         * The result for filesize when called on a folder is required to be 0
         *
         * @param string $path
-        * @return int
+        * @return int|false
         */
        public function filesize($path);
 
@@ -179,7 +179,7 @@ interface Storage {
         * see http://php.net/manual/en/function.filemtime.php
         *
         * @param string $path
-        * @return int
+        * @return int|false
         */
        public function filemtime($path);
 
@@ -187,7 +187,7 @@ interface Storage {
         * see http://php.net/manual/en/function.file_get_contents.php
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function file_get_contents($path);
 
@@ -231,7 +231,7 @@ interface Storage {
         *
         * @param string $path
         * @param string $mode
-        * @return resource
+        * @return resource|false
         */
        public function fopen($path, $mode);
 
@@ -240,7 +240,7 @@ interface Storage {
         * The mimetype for a folder is required to be "httpd/unix-directory"
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function getMimeType($path);
 
@@ -250,7 +250,7 @@ interface Storage {
         * @param string $type
         * @param string $path
         * @param bool $raw
-        * @return string
+        * @return string|false
         */
        public function hash($type, $path, $raw = false);
 
@@ -258,7 +258,7 @@ interface Storage {
         * see http://php.net/manual/en/function.free_space.php
         *
         * @param string $path
-        * @return int
+        * @return int|false
         */
        public function free_space($path);
 
@@ -266,7 +266,7 @@ interface Storage {
         * search for occurrences of $query in file names
         *
         * @param string $query
-        * @return array
+        * @return array|false
         */
        public function search($query);
 
@@ -285,7 +285,7 @@ interface Storage {
         * The local version of the file can be temporary and doesn't have to be persistent across requests
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function getLocalFile($path);
 
@@ -294,7 +294,7 @@ interface Storage {
         * The local version of the folder can be temporary and doesn't have to be persistent across requests
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function getLocalFolder($path);
        /**
@@ -313,7 +313,7 @@ interface Storage {
         * get the ETag for a file or folder
         *
         * @param string $path
-        * @return string
+        * @return string|false
         */
        public function getETag($path);
 
@@ -342,7 +342,7 @@ interface Storage {
         * For now the returned array can hold the parameter url - in future more attributes might follow.
         *
         * @param string $path
-        * @return array
+        * @return array|false
         */
        public function getDirectDownload($path);
 }
index cbd1a7e0573ede04986d2da71b156239dfcf6b70..3a976b4a26331976a1905404501cfb23112815be 100644 (file)
@@ -58,7 +58,7 @@ interface IAppConfig {
         *
         * @param string|false $key
         * @param string|false $app
-        * @return array
+        * @return array|false
         */
        public function getValues($app, $key);
 
index 238b12c64247eaa21decf35a1f527012e771d595..ec6da9eb512dac2279c824d8154380c02dc0c835 100644 (file)
@@ -97,7 +97,7 @@ interface ITags {
        * Throws an exception if the tag could not be found.
        *
        * @param string|integer $tag Tag id or name.
-       * @return array An array of object ids or false on error.
+       * @return array|false An array of object ids or false on error.
        */
        public function getIdsForTag($tag);
 
@@ -123,7 +123,7 @@ interface ITags {
        * Add a new tag.
        *
        * @param string $name A string with a name of the tag
-       * @return int the id of the added tag or false if it already exists.
+       * @return int|false the id of the added tag or false if it already exists.
        */
        public function add($name);
 
@@ -158,7 +158,7 @@ interface ITags {
        /**
        * Get favorites for an object type
        *
-       * @return array An array of object ids.
+       * @return array|false An array of object ids.
        */
        public function getFavorites();
 
index 1ae63d4c1db389bca82f0f5d9d8f9ed7d9d74cb7..0062648d82cc9cf0ad834d8cd13d79f2bed7eab4 100644 (file)
@@ -46,7 +46,7 @@ interface Share_Backend {
         * Converts the shared item sources back into the item in the specified format
         * @param array $items Shared items
         * @param int $format
-        * @return TODO
+        * @return array
         *
         * The items array is a 3-dimensional array with the item_source as the
         * first key and the share id as the second key to an array with the share