diff options
Diffstat (limited to 'lib/public')
31 files changed, 503 insertions, 92 deletions
diff --git a/lib/public/activity/imanager.php b/lib/public/activity/imanager.php index 086e430d677..449fdcc934d 100644 --- a/lib/public/activity/imanager.php +++ b/lib/public/activity/imanager.php @@ -53,6 +53,7 @@ interface IManager { * $callable has to return an instance of OCA\Activity\IConsumer * * @param \Closure $callable + * @return void */ function registerConsumer(\Closure $callable); diff --git a/lib/public/app.php b/lib/public/app.php index e0b5682242b..96162299ec4 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -85,6 +85,7 @@ class App { * Register a Configuration Screen that should appear in the personal settings section. * @param $app string appid * @param $page string page to be included + * @return void */ public static function registerPersonal( $app, $page ) { \OC_App::registerPersonal( $app, $page ); @@ -92,8 +93,9 @@ class App { /** * Register a Configuration Screen that should appear in the Admin section. - * @param $app string appid - * @param $page string page to be included + * @param string $app string appid + * @param string $page string page to be included + * @return void */ public static function registerAdmin( $app, $page ) { \OC_App::registerAdmin( $app, $page ); @@ -111,7 +113,7 @@ class App { /** * checks whether or not an app is enabled - * @param string + * @param string $app * @return boolean * * This function checks whether or not an app is enabled. @@ -122,7 +124,8 @@ class App { /** * Check if the app is enabled, redirects to home if not - * @param string + * @param string $app + * @return void */ public static function checkAppEnabled( $app ) { \OC_Util::checkAppEnabled( $app ); @@ -130,8 +133,8 @@ class App { /** * Get the last version of the app, either from appinfo/version or from appinfo/info.xml - * @param string - * @return boolean + * @param string $app + * @return string */ public static function getAppVersion( $app ) { return \OC_App::getAppVersion( $app ); diff --git a/lib/public/appframework/controller.php b/lib/public/appframework/controller.php index dc8da967871..7c2219bd046 100644 --- a/lib/public/appframework/controller.php +++ b/lib/public/appframework/controller.php @@ -68,7 +68,7 @@ abstract class Controller { * 1. URL parameters * 2. POST parameters * 3. GET parameters - * @param mixed $default If the key is not found, this value will be returned + * @param string $default If the key is not found, this value will be returned * @return mixed the content of the array */ public function params($key, $default=null){ @@ -131,7 +131,7 @@ abstract class Controller { * @param array $params the template parameters in key => value structure * @param string $renderAs user renders a full page, blank only your template * admin an entry in the admin settings - * @param array $headers set additional headers in name/value pairs + * @param string[] $headers set additional headers in name/value pairs * @return \OCP\AppFramework\Http\TemplateResponse containing the page */ public function render($templateName, array $params=array(), diff --git a/lib/public/appframework/http/response.php b/lib/public/appframework/http/response.php index 0f5a18ca4fe..d223621d4fd 100644 --- a/lib/public/appframework/http/response.php +++ b/lib/public/appframework/http/response.php @@ -155,7 +155,7 @@ class Response { /** * Get "last modified" date - * @return string RFC2822 formatted last modified date + * @return \DateTime RFC2822 formatted last modified date */ public function getLastModified() { return $this->lastModified; diff --git a/lib/public/appframework/iapi.php b/lib/public/appframework/iapi.php index 963e870f79b..c4aeea2d4e5 100644 --- a/lib/public/appframework/iapi.php +++ b/lib/public/appframework/iapi.php @@ -45,6 +45,7 @@ interface IApi { * Adds a new javascript file * @param string $scriptName the name of the javascript in js/ without the suffix * @param string $appName the name of the app, defaults to the current one + * @return void */ function addScript($scriptName, $appName = null); @@ -53,6 +54,7 @@ interface IApi { * Adds a new css file * @param string $styleName the name of the css file in css/without the suffix * @param string $appName the name of the app, defaults to the current one + * @return void */ function addStyle($styleName, $appName = null); @@ -60,6 +62,7 @@ interface IApi { /** * shorthand for addScript for files in the 3rdparty directory * @param string $name the name of the file without the suffix + * @return void */ function add3rdPartyScript($name); @@ -67,6 +70,7 @@ interface IApi { /** * shorthand for addStyle for files in the 3rdparty directory * @param string $name the name of the file without the suffix + * @return void */ function add3rdPartyStyle($name); diff --git a/lib/public/appframework/iappcontainer.php b/lib/public/appframework/iappcontainer.php index 7e6ec6016b7..e4f5f37cad2 100644 --- a/lib/public/appframework/iappcontainer.php +++ b/lib/public/appframework/iappcontainer.php @@ -66,8 +66,8 @@ interface IAppContainer extends IContainer{ function isAdminUser(); /** - * @param $message - * @param $level + * @param string $message + * @param string $level * @return mixed */ function log($message, $level); diff --git a/lib/public/backgroundjob.php b/lib/public/backgroundjob.php index a7f54491dfa..03b94403b47 100644 --- a/lib/public/backgroundjob.php +++ b/lib/public/backgroundjob.php @@ -33,7 +33,7 @@ use \OC\BackgroundJob\JobList; /** * This class provides functions to register backgroundjobs in ownCloud * - * To create a new backgroundjob create a new class that inharits from either \OC\BackgroundJob\Job, + * To create a new backgroundjob create a new class that inherits from either \OC\BackgroundJob\Job, * \OC\BackgroundJob\QueuedJob or \OC\BackgroundJob\TimedJob and register it using * \OCP\BackgroundJob->registerJob($job, $argument), $argument will be passed to the run() function * of the job when the job is executed. @@ -59,7 +59,7 @@ class BackgroundJob { * sets the background jobs execution type * * @param string $type execution type - * @return boolean + * @return false|null * * This method sets the execution type of the background jobs. Possible types * are "none", "ajax", "webcron", "cron" @@ -69,11 +69,11 @@ class BackgroundJob { } /** - * @param \OC\BackgroundJob\Job|string $job + * @param string $job * @param mixed $argument */ public static function registerJob($job, $argument = null) { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); $jobList->add($job, $argument); } @@ -82,7 +82,7 @@ class BackgroundJob { * creates a regular task * @param string $klass class name * @param string $method method name - * @return true + * @return boolean|null */ public static function addRegularTask($klass, $method) { if (!\OC::needUpgrade()) { @@ -99,7 +99,7 @@ class BackgroundJob { * key is string "$klass-$method", value is array( $klass, $method ) */ static public function allRegularTasks() { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); $allJobs = $jobList->getAll(); $regularJobs = array(); foreach ($allJobs as $job) { @@ -115,10 +115,10 @@ class BackgroundJob { * @deprecated * Gets one queued task * @param int $id ID of the task - * @return associative array + * @return BackgroundJob\IJob array */ public static function findQueuedTask($id) { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); return $jobList->getById($id); } @@ -128,7 +128,7 @@ class BackgroundJob { * @return array with associative arrays */ public static function allQueuedTasks() { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); $allJobs = $jobList->getAll(); $queuedJobs = array(); foreach ($allJobs as $job) { @@ -148,7 +148,7 @@ class BackgroundJob { * @return array with associative arrays */ public static function queuedTaskWhereAppIs($app) { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); $allJobs = $jobList->getAll(); $queuedJobs = array(); foreach ($allJobs as $job) { @@ -170,7 +170,7 @@ class BackgroundJob { * @param string $class class name * @param string $method method name * @param string $parameters all useful data as text - * @return int id of task + * @return boolean id of task */ public static function addQueuedTask($app, $class, $method, $parameters) { self::registerJob('OC\BackgroundJob\Legacy\QueuedJob', array('app' => $app, 'klass' => $class, 'method' => $method, 'parameters' => $parameters)); @@ -181,12 +181,12 @@ class BackgroundJob { * @deprecated * deletes a queued task * @param int $id id of task - * @return bool + * @return boolean|null * * Deletes a report */ public static function deleteQueuedTask($id) { - $jobList = new JobList(); + $jobList = \OC::$server->getJobList(); $job = $jobList->getById($id); if ($job) { $jobList->remove($job); diff --git a/lib/public/backgroundjob/ijob.php b/lib/public/backgroundjob/ijob.php new file mode 100644 index 00000000000..eaf11c4f684 --- /dev/null +++ b/lib/public/backgroundjob/ijob.php @@ -0,0 +1,43 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\BackgroundJob; + +interface IJob { + /** + * Run the background job with the registered argument + * + * @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job + * @param \OC\Log $logger + * @return void + */ + public function execute($jobList, $logger = null); + + /** + * Get the id of the background job + * This id is determined by the job list when a job is added to the list + * + * @return int + */ + public function getId(); + + /** + * Get the last time this job was run as unix timestamp + * + * @return int + */ + public function getLastRun(); + + /** + * Get the argument associated with the background job + * This is the argument that will be passed to the background job + * + * @return mixed + */ + public function getArgument(); +} diff --git a/lib/public/backgroundjob/ijoblist.php b/lib/public/backgroundjob/ijoblist.php new file mode 100644 index 00000000000..c9b546605b8 --- /dev/null +++ b/lib/public/backgroundjob/ijoblist.php @@ -0,0 +1,82 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OCP\BackgroundJob; + +interface IJobList { + /** + * Add a job to the list + * + * @param \OCP\BackgroundJob\IJob |string $job + * @param mixed $argument The argument to be passed to $job->run() when the job is exectured + * @param string $job + * @return void + */ + public function add($job, $argument = null); + + /** + * Remove a job from the list + * + * @param IJob $job + * @param mixed $argument + * @return void + */ + public function remove($job, $argument = null); + + /** + * check if a job is in the list + * + * @param $job + * @param mixed $argument + * @return bool + */ + public function has($job, $argument); + + /** + * get all jobs in the list + * + * @return \OCP\BackgroundJob\IJob[] + */ + public function getAll(); + + /** + * get the next job in the list + * + * @return \OCP\BackgroundJob\IJob + */ + public function getNext(); + + /** + * @param int $id + * @return \OCP\BackgroundJob\IJob + */ + public function getById($id); + + /** + * set the job that was last ran to the current time + * + * @param \OCP\BackgroundJob\IJob $job + * @return void + */ + public function setLastJob($job); + + /** + * get the id of the last ran job + * + * @return int + */ + public function getLastJob(); + + /** + * set the lastRun of $job to now + * + * @param \OCP\BackgroundJob\IJob $job + * @return void + */ + public function setLastRun($job); +} diff --git a/lib/public/config.php b/lib/public/config.php index d9355a0605f..bb973939f44 100644 --- a/lib/public/config.php +++ b/lib/public/config.php @@ -42,7 +42,7 @@ class Config { /** * Gets a value from config.php * @param string $key key - * @param string $default = null default value + * @param mixed $default = null default value * @return string the value or $default * * This function gets the value from config.php. If it does not exist, @@ -55,7 +55,7 @@ class Config { /** * Sets a value * @param string $key key - * @param string $value value + * @param mixed $value value * @return bool * * This function sets the value and writes the config.php. If the file can @@ -89,7 +89,7 @@ class Config { * @param string $app app * @param string $key key * @param string $value value - * @return string true/false + * @return boolean true/false * * Sets a value. If the key did not exist before it will be created. */ diff --git a/lib/public/contacts/imanager.php b/lib/public/contacts/imanager.php index 973d48be5ec..5b9d64ecc41 100644 --- a/lib/public/contacts/imanager.php +++ b/lib/public/contacts/imanager.php @@ -96,7 +96,7 @@ namespace OCP\Contacts { * This function can be used to delete the contact identified by the given id * * @param object $id the unique identifier to a contact - * @param $address_book_key + * @param $address_book_key * @return bool successful or not */ function delete($id, $address_book_key); @@ -106,7 +106,7 @@ namespace OCP\Contacts { * Otherwise the contact will be updated by replacing the entire data set. * * @param array $properties this array if key-value-pairs defines a contact - * @param $address_book_key string to identify the address book in which the contact shall be created or updated + * @param $address_book_key string to identify the address book in which the contact shall be created or updated * @return array representing the contact just created or updated */ function createOrUpdate($properties, $address_book_key); @@ -122,6 +122,7 @@ namespace OCP\Contacts { * Registers an address book * * @param \OCP\IAddressBook $address_book + * @return void */ function registerAddressBook(\OCP\IAddressBook $address_book); @@ -129,6 +130,7 @@ namespace OCP\Contacts { * Unregisters an address book * * @param \OCP\IAddressBook $address_book + * @return void */ function unregisterAddressBook(\OCP\IAddressBook $address_book); @@ -138,6 +140,7 @@ namespace OCP\Contacts { * * @param string $key * @param \Closure $callable + * @return void */ function register($key, \Closure $callable); @@ -148,6 +151,7 @@ namespace OCP\Contacts { /** * removes all registered address book instances + * @return void */ function clear(); } diff --git a/lib/public/db.php b/lib/public/db.php index 4a19d78d444..cb876b4d1f9 100644 --- a/lib/public/db.php +++ b/lib/public/db.php @@ -39,7 +39,7 @@ class DB { * @param string $query Query string * @param int $limit Limit of the SQL statement * @param int $offset Offset of the SQL statement - * @return \Doctrine\DBAL\Statement prepared SQL query + * @return \OC_DB_StatementWrapper prepared SQL query * * SQL query via Doctrine prepare(), needs to be execute()'d! */ @@ -49,7 +49,7 @@ class DB { /** * Insert a row if a matching row doesn't exists. - * @param $table string The table name (will replace *PREFIX*) to perform the replace on. + * @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix * @param $input array * * The input array if in the form: @@ -70,8 +70,8 @@ class DB { /** * Gets last value of autoincrement - * @param $table string The optional table name (will replace *PREFIX*) and add sequence suffix - * @return int + * @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix + * @return string * * \Doctrine\DBAL\Connection lastInsertID() * diff --git a/lib/public/files.php b/lib/public/files.php index d36d74fdf77..e2d9c81d442 100644 --- a/lib/public/files.php +++ b/lib/public/files.php @@ -37,7 +37,6 @@ namespace OCP; class Files { /** * Recusive deletion of folders - * @param string path to the folder * @return bool */ static function rmdirr( $dir ) { @@ -46,7 +45,7 @@ class Files { /** * Get the mimetype form a local file - * @param string path + * @param string $path * @return string * does NOT work for ownClouds filesystem, use OC_FileSystem::getMimeType instead */ @@ -56,7 +55,7 @@ class Files { /** * Search for files by mimetype - * @param string mimetype + * @param string $mimetype * @return array */ static public function searchByMime( $mimetype ) { @@ -65,8 +64,8 @@ class Files { /** * Copy the contents of one stream to another - * @param resource source - * @param resource target + * @param resource $source + * @param resource $target * @return int the number of bytes copied */ public static function streamCopy( $source, $target ) { @@ -76,7 +75,7 @@ class Files { /** * Create a temporary file with an unique filename - * @param string postfix + * @param string $postfix * @return string * * temporary files are automatically cleaned up after the script is finished @@ -97,8 +96,8 @@ class Files { /** * Adds a suffix to the name in case the file exists - * @param string path - * @param string filename + * @param string $path + * @param string $filename * @return string */ public static function buildNotExistingFileName( $path, $filename ) { @@ -108,7 +107,7 @@ class Files { /** * Gets the Storage for an app - creates the needed folder if they are not * existant - * @param string appid + * @param string $app * @return \OC\Files\View */ public static function getStorage( $app ) { diff --git a/lib/public/files/file.php b/lib/public/files/file.php index c6cda59f9b0..6208aeff426 100644 --- a/lib/public/files/file.php +++ b/lib/public/files/file.php @@ -43,6 +43,7 @@ interface File extends Node { * * @param string $data * @throws \OCP\Files\NotPermittedException + * @return void */ public function putContent($data); diff --git a/lib/public/files/fileinfo.php b/lib/public/files/fileinfo.php new file mode 100644 index 00000000000..68ce45d3fa1 --- /dev/null +++ b/lib/public/files/fileinfo.php @@ -0,0 +1,138 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +namespace OCP\Files; + +interface FileInfo { + const TYPE_FILE = 'file'; + const TYPE_FOLDER = 'folder'; + + /** + * Get the Etag of the file or folder + * + * @return string + */ + public function getEtag(); + + /** + * Get the size in bytes for the file or folder + * + * @return int + */ + public function getSize(); + + /** + * Get the last modified date as timestamp for the file or folder + * + * @return int + */ + public function getMtime(); + + /** + * Get the name of the file or folder + * + * @return string + */ + public function getName(); + + /** + * Get the path relative to the storage + * + * @return string + */ + public function getInternalPath(); + + /** + * Get the absolute path + * + * @return string + */ + public function getPath(); + + /** + * Get the full mimetype of the file or folder i.e. 'image/png' + * + * @return string + */ + public function getMimetype(); + + /** + * Get the first part of the mimetype of the file or folder i.e. 'image' + * + * @return string + */ + public function getMimePart(); + + /** + * Get the storage the file or folder is storage on + * + * @return \OCP\Files\Storage + */ + public function getStorage(); + + /** + * Get the file id of the file or folder + * + * @return int + */ + public function getId(); + + /** + * Check whether the file is encrypted + * + * @return bool + */ + public function isEncrypted(); + + /** + * Get the permissions of the file or folder as bitmasked combination of the following constants + * \OCP\PERMISSION_CREATE + * \OCP\PERMISSION_READ + * \OCP\PERMISSION_UPDATE + * \OCP\PERMISSION_DELETE + * \OCP\PERMISSION_SHARE + * \OCP\PERMISSION_ALL + * + * @return int + */ + public function getPermissions(); + + /** + * Check whether this is a file or a folder + * + * @return \OCP\Files\FileInfo::TYPE_FILE | \OCP\Files\FileInfo::TYPE_FOLDER + */ + public function getType(); + + /** + * Check if the file or folder is readable + * + * @return bool + */ + public function isReadable(); + + /** + * Check if a file is writable + * + * @return bool + */ + public function isUpdateable(); + + /** + * Check if a file or folder can be deleted + * + * @return bool + */ + public function isDeletable(); + + /** + * Check if a file or folder can be shared + * + * @return bool + */ + public function isShareable(); +} diff --git a/lib/public/files/node.php b/lib/public/files/node.php index 972b1cfa492..a380394095b 100644 --- a/lib/public/files/node.php +++ b/lib/public/files/node.php @@ -41,6 +41,7 @@ interface Node { /** * Delete the file or folder + * @return void */ public function delete(); @@ -58,6 +59,7 @@ interface Node { * * @param int $mtime (optional) modified date as unix timestamp * @throws \OCP\Files\NotPermittedException + * @return void */ public function touch($mtime = null); diff --git a/lib/public/files/storage.php b/lib/public/files/storage.php index fe30f8f50af..5ec8ac6245c 100644 --- a/lib/public/files/storage.php +++ b/lib/public/files/storage.php @@ -39,6 +39,7 @@ interface Storage { * $parameters is a free form array with the configuration options needed to construct the storage * * @param array $parameters + * @return void */ public function __construct($parameters); diff --git a/lib/public/iappconfig.php b/lib/public/iappconfig.php new file mode 100644 index 00000000000..1f31898bf2c --- /dev/null +++ b/lib/public/iappconfig.php @@ -0,0 +1,93 @@ +<?php +/** + * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ +namespace OCP; + +/** + * This class provides an easy way for apps to store config values in the + * database. + */ +interface IAppConfig { + /** + * @brief check if a key is set in the appconfig + * @param string $app + * @param string $key + * @return bool + */ + public function hasKey($app, $key); + + /** + * @brief Gets the config value + * @param string $app app + * @param string $key key + * @param string $default = null, default value if the key does not exist + * @return string the value or $default + * + * This function gets a value from the appconfig table. If the key does + * not exist the default value will be returned + */ + public function getValue($app, $key, $default = null); + + /** + * @brief Deletes a key + * @param string $app app + * @param string $key key + * @return bool + * + * Deletes a key. + */ + public function deleteKey($app, $key); + + /** + * @brief Get the available keys for an app + * @param string $app the app we are looking for + * @return array with key names + * + * This function gets all keys of an app. Please note that the values are + * not returned. + */ + public function getKeys($app); + + /** + * get multiply values, either the app or key can be used as wildcard by setting it to false + * + * @param app + * @param key + * @param string $key + * @return array + */ + public function getValues($app, $key); + + /** + * @brief sets a value in the appconfig + * @param string $app app + * @param string $key key + * @param string $value value + * + * Sets a value. If the key did not exist before it will be created. + * @return void + */ + public function setValue($app, $key, $value); + + /** + * @brief Get all apps using the config + * @return array with app ids + * + * This function returns a list of all apps that have at least one + * entry in the appconfig table. + */ + public function getApps(); + + /** + * @brief Remove app from appconfig + * @param string $app app + * @return bool + * + * Removes all keys in appconfig belonging to the app. + */ + public function deleteApp($app); +} diff --git a/lib/public/iavatar.php b/lib/public/iavatar.php index 2cbec0d45c3..43fa32556de 100644 --- a/lib/public/iavatar.php +++ b/lib/public/iavatar.php @@ -22,7 +22,7 @@ interface IAvatar { /** * @brief sets the users avatar - * @param $data mixed imagedata or path to set a new avatar + * @param Image $data mixed imagedata or path to set a new avatar * @throws Exception if the provided file is not a jpg or png image * @throws Exception if the provided image is not valid * @throws \OCP\NotSquareException if the image is not square diff --git a/lib/public/iconfig.php b/lib/public/iconfig.php index 1d0f8e0015c..0ebbd9f5a71 100644 --- a/lib/public/iconfig.php +++ b/lib/public/iconfig.php @@ -38,7 +38,7 @@ interface IConfig { * Sets a new system wide value * * @param string $key the key of the value, under which will be saved - * @param string $value the value that should be stored + * @param mixed $value the value that should be stored * @todo need a use case for this */ // public function setSystemValue($key, $value); @@ -59,6 +59,7 @@ interface IConfig { * @param string $appName the appName that we want to store the value under * @param string $key the key of the value, under which will be saved * @param string $value the value that should be stored + * @return void */ public function setAppValue($appName, $key, $value); @@ -80,6 +81,7 @@ interface IConfig { * @param string $appName the appName that we want to store the value under * @param string $key the key under which the value is being stored * @param string $value the value that you want to store + * @return void */ public function setUserValue($userId, $appName, $key, $value); @@ -90,6 +92,7 @@ interface IConfig { * @param string $appName the appName that we stored the value under * @param string $key the key under which the value is being stored * @param string $default the default value to be returned if the value isn't set + * @return string */ public function getUserValue($userId, $appName, $key, $default = ''); } diff --git a/lib/public/il10n.php b/lib/public/il10n.php index 817b299b0b7..1c025e7824f 100644 --- a/lib/public/il10n.php +++ b/lib/public/il10n.php @@ -25,7 +25,7 @@ interface IL10N { * Translating * @param $text String The text we need a translation for * @param array $parameters default:array() Parameters for sprintf - * @return \OC_L10N_String|string Translation or the same text + * @return \OC_L10N_String Translation or the same text * * Returns the translation. If no translation is found, $text will be * returned. @@ -38,7 +38,7 @@ interface IL10N { * @param $text_plural String the string to translate for n objects * @param $count Integer Number of objects * @param array $parameters default:array() Parameters for sprintf - * @return \OC_L10N_String|string Translation or the same text + * @return \OC_L10N_String Translation or the same text * * Returns the translation. If no translation is found, $text will be * returned. %n will be replaced with the number of objects. diff --git a/lib/public/inavigationmanager.php b/lib/public/inavigationmanager.php index 73e85d03761..9497d3fd08e 100644 --- a/lib/public/inavigationmanager.php +++ b/lib/public/inavigationmanager.php @@ -37,12 +37,14 @@ interface INavigationManager { /** * Creates a new navigation entry * @param array $entry containing: id, name, order, icon and href key + * @return void */ public function add(array $entry); /** * Sets the current navigation entry of the currently running app * @param string $appId id of the app entry to activate (from added $entry) + * @return void */ public function setActiveEntry($appId); } diff --git a/lib/public/irequest.php b/lib/public/irequest.php index ca23e12b7f5..d77a9bc887a 100644 --- a/lib/public/irequest.php +++ b/lib/public/irequest.php @@ -55,6 +55,11 @@ namespace OCP; interface IRequest { + /** + * @param string $name + * + * @return string + */ function getHeader($name); /** diff --git a/lib/public/iservercontainer.php b/lib/public/iservercontainer.php index 5473f3ee334..5fb51f9ecd5 100644 --- a/lib/public/iservercontainer.php +++ b/lib/public/iservercontainer.php @@ -114,6 +114,13 @@ interface IServerContainer { function getConfig(); /** + * Returns the app config manager + * + * @return \OCP\IAppConfig + */ + function getAppConfig(); + + /** * get an L10N instance * @param $app string appid * @return \OCP\IL10N @@ -176,4 +183,11 @@ interface IServerContainer { */ function getAvatarManager(); + /** + * Returns an job list for controlling background jobs + * + * @return \OCP\BackgroundJob\IJobList + */ + function getJobList(); + } diff --git a/lib/public/itags.php b/lib/public/itags.php index ea62fb38ecb..f8ebaa668f1 100644 --- a/lib/public/itags.php +++ b/lib/public/itags.php @@ -49,7 +49,7 @@ interface ITags { /** * Check if any tags are saved for this type and user. * - * @return boolean. + * @return boolean */ public function isEmpty(); @@ -147,7 +147,7 @@ interface ITags { * Creates a tag/object relation. * * @param int $objid The id of the object - * @param int|string $tag The id or name of the tag + * @param string $tag The id or name of the tag * @return boolean Returns false on database error. */ public function tagAs($objid, $tag); @@ -156,7 +156,7 @@ interface ITags { * Delete single tag/object relation from the db * * @param int $objid The id of the object - * @param int|string $tag The id or name of the tag + * @param string $tag The id or name of the tag * @return boolean */ public function unTag($objid, $tag); diff --git a/lib/public/iusersession.php b/lib/public/iusersession.php index 131b326ab90..adc706cc7c3 100644 --- a/lib/public/iusersession.php +++ b/lib/public/iusersession.php @@ -45,6 +45,7 @@ interface IUserSession { /** * Logs the user out including all the session data * Logout, destroys session + * @return void */ public function logout(); diff --git a/lib/public/json.php b/lib/public/json.php index cd5d233ef90..e7371ad63f3 100644 --- a/lib/public/json.php +++ b/lib/public/json.php @@ -81,7 +81,7 @@ class JSON { * parameter to the ajax call, then assign it to the template and finally * add a hidden input field also named 'requesttoken' containing the value. * - * @return string json formatted error string if not valid. + * @return \json|null json formatted error string if not valid. */ public static function callCheck() { return(\OC_JSON::callCheck()); diff --git a/lib/public/share.php b/lib/public/share.php index ae7d29e8b87..ebc555dba5f 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -78,7 +78,10 @@ class Share { * @param string Backend class * @param string (optional) Depends on item type * @param array (optional) List of supported file extensions if this item type depends on files - * @return Returns true if backend is registered or false if error + * @param string $itemType + * @param string $class + * @param string $collectionOf + * @return boolean true if backend is registered or false if error */ public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) { if (self::isEnabled()) { @@ -104,7 +107,7 @@ class Share { /** * Check if the Share API is enabled - * @return Returns true if enabled or false + * @return boolean true if enabled or false * * The Share API is enabled by default if not configured */ @@ -135,7 +138,7 @@ class Share { /** * Find which users can access a shared item - * @param $path to the file + * @param string $path to the file * @param $user owner of the file * @param include owner to the list of users with access to the file * @return array @@ -247,6 +250,7 @@ class Share { * @param mixed Parameters (optional) * @param int Number of items to return (optional) Returns all by default * @param bool include collections (optional) + * @param string $itemType * @return Return depends on format */ public static function getItemsSharedWith($itemType, $format = self::FORMAT_NONE, @@ -262,7 +266,7 @@ class Share { * @param int $format (optional) Format type must be defined by the backend * @param mixed Parameters (optional) * @param bool include collections (optional) - * @return Return depends on format + * @return string depends on format */ public static function getItemSharedWith($itemType, $itemTarget, $format = self::FORMAT_NONE, $parameters = null, $includeCollections = false) { @@ -403,6 +407,7 @@ class Share { * @param mixed Parameters * @param int Number of items to return (optional) Returns all by default * @param bool include collections + * @param string $itemType * @return Return depends on format */ public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null, @@ -646,7 +651,7 @@ class Share { * @param string Item source * @param int SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK * @param string User or group the item is being shared with - * @return Returns true on success or false on failure + * @return boolean true on success or false on failure */ public static function unshare($itemType, $itemSource, $shareType, $shareWith) { if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), @@ -661,7 +666,9 @@ class Share { * Unshare an item from all users, groups, and remove all links * @param string Item type * @param string Item source - * @return Returns true on success or false on failure + * @param string $itemType + * @param string $itemSource + * @return boolean true on success or false on failure */ public static function unshareAll($itemType, $itemSource) { // Get all of the owners of shares of this item. @@ -693,7 +700,9 @@ class Share { * Unshare an item shared with the current user * @param string Item type * @param string Item target - * @return Returns true on success or false on failure + * @param string $itemType + * @param string $itemTarget + * @return boolean true on success or false on failure * * Unsharing from self is not allowed for items inside collections */ @@ -749,12 +758,12 @@ class Share { /** * Set the permissions of an item for a specific user or group - * @param string Item type - * @param string Item source - * @param int SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK - * @param string User or group the item is being shared with - * @param int CRUDS permissions - * @return Returns true on success or false on failure + * @param string $itemType Item type + * @param string $itemSource Item source + * @param int $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK + * @param string $shareWith User or group the item is being shared with + * @param integer|null $permissions CRUDS + * @return boolean true on success or false on failure */ public static function setPermissions($itemType, $itemSource, $shareType, $shareWith, $permissions) { if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, @@ -836,7 +845,7 @@ class Share { * @param string $itemType * @param string $itemSource * @param string $date expiration date - * @return Share_Backend + * @return boolean */ public static function setExpirationDate($itemType, $itemSource, $date) { if ($items = self::getItems($itemType, $itemSource, null, null, \OC_User::getUser(), @@ -930,7 +939,7 @@ class Share { /** * Check if resharing is allowed - * @return Returns true if allowed or false + * @return boolean true if allowed or false * * Resharing is allowed by default if not configured */ @@ -1380,15 +1389,15 @@ class Share { /** * Put shared item into the database - * @param string Item type - * @param string Item source - * @param int SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK - * @param string User or group the item is being shared with - * @param string User that is the owner of shared item - * @param int CRUDS permissions - * @param bool|array Parent folder target (optional) - * @param string token (optional) - * @param string name of the source item (optional) + * @param string $itemType Item type + * @param string $itemSource Item source + * @param integer $shareType SHARE_TYPE_USER, SHARE_TYPE_GROUP, or SHARE_TYPE_LINK + * @param string $shareWith User or group the item is being shared with + * @param string $uidOwner User that is the owner of shared item + * @param int $permissions CRUDS permissions + * @param bool|array, $parentFolder Parent folder target (optional) + * @param string $token (optional) + * @param string $itemSourceName name of the source item (optional) * @return bool Returns true on success or false on failure */ private static function put($itemType, $itemSource, $shareType, $shareWith, $uidOwner, @@ -1629,6 +1638,7 @@ class Share { * @param string User that is the owner of shared item * @param string The suggested target originating from a reshare (optional) * @param int The id of the parent group share (optional) + * @param integer $shareType * @return string Item target */ private static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, @@ -1936,7 +1946,9 @@ interface Share_Backend { * Get the source of the item to be stored in the database * @param string Item source * @param string Owner of the item - * @return mixed|array|false Source + * @param string $itemSource + * @param string $uidOwner + * @return boolean Source * * Return an array if the item is file dependent, the array needs two keys: 'item' and 'file' * Return false if the item does not exist for the user @@ -1959,8 +1971,8 @@ interface Share_Backend { /** * Converts the shared item sources back into the item in the specified format - * @param array Shared items - * @param int Format + * @param array $items Shared items + * @param integer $format * @return TODO * * The items array is a 3-dimensional array with the item_source as the @@ -1992,6 +2004,9 @@ interface Share_Backend_File_Dependent extends Share_Backend { * Get the file path of the item * @param string Item source * @param string User that is the owner of shared item + * @param string $itemSource + * @param string $uidOwner + * @return boolean */ public function getFilePath($itemSource, $uidOwner); diff --git a/lib/public/template.php b/lib/public/template.php index 320b7c6393f..9a994c1bea8 100644 --- a/lib/public/template.php +++ b/lib/public/template.php @@ -35,7 +35,7 @@ namespace OCP; * Make OC_Helper::imagePath available as a simple function * @param string app * @param string image - * @return link to the image + * @return string to the image * * @see OC_Helper::imagePath */ @@ -47,7 +47,7 @@ function image_path( $app, $image ) { /** * Make OC_Helper::mimetypeIcon available as a simple function * @param string mimetype - * @return path to the image of this file type. + * @return string to the image of this file type. */ function mimetype_icon( $mimetype ) { return(\mimetype_icon( $mimetype )); @@ -56,7 +56,7 @@ function mimetype_icon( $mimetype ) { /** * Make preview_icon available as a simple function * @param string path of file - * @return path to the preview of the image + * @return string to the preview of the image */ function preview_icon( $path ) { return(\preview_icon( $path )); @@ -65,8 +65,8 @@ function preview_icon( $path ) { /** * Make publicpreview_icon available as a simple function * Returns the path to the preview of the image. - * @param string path of file - * @param string token + * @param string $path of file + * @param string $token * @return link to the preview */ function publicPreview_icon ( $path, $token ) { @@ -77,7 +77,7 @@ function publicPreview_icon ( $path, $token ) { * Make OC_Helper::humanFileSize available as a simple function * Example: 2048 to 2 kB. * @param int size in bytes - * @return size as string + * @return string size as string */ function human_file_size( $bytes ) { return(\human_file_size( $bytes )); @@ -88,7 +88,7 @@ function human_file_size( $bytes ) { * Return the relative date in relation to today. Returns something like "last hour" or "two month ago" * @param int unix timestamp * @param boolean date only - * @return human readable interpretation of the timestamp + * @return OC_L10N_String human readable interpretation of the timestamp */ function relative_modified_date( $timestamp, $dateOnly = false ) { return(\relative_modified_date($timestamp, null, $dateOnly)); @@ -99,7 +99,7 @@ function relative_modified_date( $timestamp, $dateOnly = false ) { * Return a human readable outout for a file size. * @deprecated human_file_size() instead * @param integer size of a file in byte - * @return human readable interpretation of a file size + * @return string human readable interpretation of a file size */ function simple_file_size($bytes) { return(\human_file_size($bytes)); @@ -111,7 +111,7 @@ function simple_file_size($bytes) { * @param $options the options * @param $selected which one is selected? * @param array the parameters - * @return html options + * @return string html options */ function html_select_options($options, $selected, $params=array()) { return(\html_select_options($options, $selected, $params)); diff --git a/lib/public/user.php b/lib/public/user.php index acc0e3b737b..7bac938b838 100644 --- a/lib/public/user.php +++ b/lib/public/user.php @@ -46,8 +46,8 @@ class User { /** * Get a list of all users * @param string search pattern - * @param int limit - * @param int offset + * @param integer $limit + * @param integer $offset * @return array with all uids */ public static function getUsers( $search = '', $limit = null, $offset = null ) { @@ -101,9 +101,9 @@ class User { /** * Check if the password is correct - * @param string The username - * @param string The password - * @return mixed username on success, false otherwise + * @param string $uid The username + * @param string $password The password + * @return string|false username on success, false otherwise * * Check if the password is correct without logging in the user */ diff --git a/lib/public/util.php b/lib/public/util.php index 4611e5e2650..570283e2a8a 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -121,7 +121,7 @@ class Util { /** * get l10n object * @param string $application - * @return OC_L10N + * @return \OC_L10N */ public static function getL10N( $application ) { return \OC_L10N::get( $application ); |