Merge pull request #7274 from owncloud/scrutinizer-patch-1

Scrutinizer Auto-Fixes
This commit is contained in:
Morris Jobke 2014-02-19 11:51:04 +01:00
commit bcad6e641a
101 changed files with 261 additions and 97 deletions

View File

@ -425,7 +425,7 @@ class Helper {
/** /**
* @brief glob uses different pattern than regular expressions, escape glob pattern only * @brief glob uses different pattern than regular expressions, escape glob pattern only
* @param string $path unescaped path * @param string $path unescaped path
* @return escaped path * @return string path
*/ */
public static function escapeGlobPattern($path) { public static function escapeGlobPattern($path) {
return preg_replace('/(\*|\?|\[)/', '[$1]', $path); return preg_replace('/(\*|\?|\[)/', '[$1]', $path);

View File

@ -67,7 +67,7 @@ class Google extends \OC\Files\Storage\Common {
/** /**
* Get the Google_DriveFile object for the specified path * Get the Google_DriveFile object for the specified path
* @param string $path * @param string $path
* @return Google_DriveFile|false * @return string
*/ */
private function getDriveFile($path) { private function getDriveFile($path) {
// Remove leading and trailing slashes // Remove leading and trailing slashes

View File

@ -11,6 +11,7 @@ namespace OC\Files\Storage;
abstract class StreamWrapper extends Common { abstract class StreamWrapper extends Common {
/** /**
* @param string $path
* @return string|null * @return string|null
*/ */
abstract public function constructUrl($path); abstract public function constructUrl($path);

View File

@ -336,6 +336,9 @@ class DAV extends \OC\Files\Storage\Common{
} }
} }
/**
* @param string $path
*/
public function cleanPath($path) { public function cleanPath($path) {
$path = \OC\Files\Filesystem::normalizePath($path); $path = \OC\Files\Filesystem::normalizePath($path);
// remove leading slash // remove leading slash

View File

@ -396,7 +396,7 @@ class Shared_Cache extends Cache {
* use the one with the highest id gives the best result with the background scanner, since that is most * use the one with the highest id gives the best result with the background scanner, since that is most
* likely the folder where we stopped scanning previously * likely the folder where we stopped scanning previously
* *
* @return string|bool the path of the folder or false when no folder matched * @return boolean the path of the folder or false when no folder matched
*/ */
public function getIncomplete() { public function getIncomplete() {
return false; return false;

View File

@ -41,6 +41,7 @@ class Shared extends \OC\Files\Storage\Common {
/** /**
* @brief Get the source file path, permissions, and owner for a shared file * @brief Get the source file path, permissions, and owner for a shared file
* @param string Shared target file path * @param string Shared target file path
* @param string $target
* @return Returns array with the keys path, permissions, and owner or false if not found * @return Returns array with the keys path, permissions, and owner or false if not found
*/ */
public function getFile($target) { public function getFile($target) {

View File

@ -336,7 +336,7 @@ class Storage {
* @brief deletes used space for files versions in db if user was deleted * @brief deletes used space for files versions in db if user was deleted
* *
* @param type $uid id of deleted user * @param type $uid id of deleted user
* @return result of db delete operation * @return \OC_DB_StatementWrapper of db delete operation
*/ */
public static function deleteUser($uid) { public static function deleteUser($uid) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_versions` WHERE `user`=?'); $query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_versions` WHERE `user`=?');
@ -420,8 +420,8 @@ class Storage {
/** /**
* @brief get list of files we want to expire * @brief get list of files we want to expire
* @param integer $currentTime timestamp of current time
* @param array $versions list of versions * @param array $versions list of versions
* @param integer $time
* @return array containing the list of to deleted versions and the size of them * @return array containing the list of to deleted versions and the size of them
*/ */
protected static function getExpireList($time, $versions) { protected static function getExpireList($time, $versions) {

View File

@ -164,6 +164,7 @@ class Access extends LDAPUtility {
/** /**
* gives back the database table for the query * gives back the database table for the query
* @param boolean $isUser
*/ */
private function getMapTable($isUser) { private function getMapTable($isUser) {
if($isUser) { if($isUser) {
@ -644,6 +645,8 @@ class Access extends LDAPUtility {
* @brief executes an LDAP search, optimized for Users * @brief executes an LDAP search, optimized for Users
* @param $filter the LDAP filter for the search * @param $filter the LDAP filter for the search
* @param $attr optional, when a certain attribute shall be filtered out * @param $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @returns array with the search result * @returns array with the search result
* *
* Executes an LDAP search * Executes an LDAP search
@ -661,8 +664,10 @@ class Access extends LDAPUtility {
/** /**
* @brief executes an LDAP search, optimized for Groups * @brief executes an LDAP search, optimized for Groups
* @param $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param $attr optional, when a certain attribute shall be filtered out * @param $attr optional, when a certain attribute shall be filtered out
* @param integer $limit
* @param integer $offset
* @returns array with the search result * @returns array with the search result
* *
* Executes an LDAP search * Executes an LDAP search
@ -757,7 +762,7 @@ class Access extends LDAPUtility {
/** /**
* @brief executes an LDAP search, but counts the results only * @brief executes an LDAP search, but counts the results only
* @param $filter the LDAP filter for the search * @param string $filter the LDAP filter for the search
* @param $base an array containing the LDAP subtree(s) that shall be searched * @param $base an array containing the LDAP subtree(s) that shall be searched
* @param $attr optional, array, one or more attributes that shall be * @param $attr optional, array, one or more attributes that shall be
* retrieved. Results will according to the order in the array. * retrieved. Results will according to the order in the array.
@ -1006,6 +1011,9 @@ class Access extends LDAPUtility {
return $this->combineFilterWithOr($filter); return $this->combineFilterWithOr($filter);
} }
/**
* @param string $password
*/
public function areCredentialsValid($name, $password) { public function areCredentialsValid($name, $password) {
$name = $this->DNasBaseParameter($name); $name = $this->DNasBaseParameter($name);
$testConnection = clone $this->connection; $testConnection = clone $this->connection;

View File

@ -159,6 +159,9 @@ class Connection extends LDAPUtility {
return unserialize(base64_decode($this->cache->get($key))); return unserialize(base64_decode($this->cache->get($key)));
} }
/**
* @param string $key
*/
public function isCached($key) { public function isCached($key) {
if(!$this->configured) { if(!$this->configured) {
$this->readConfiguration(); $this->readConfiguration();

View File

@ -56,8 +56,13 @@ abstract class Proxy {
/** /**
* @param boolean $passOnWhen * @param boolean $passOnWhen
* @param string $method
*/ */
abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen);
/**
* @param string $method
*/
abstract protected function walkBackends($id, $method, $parameters); abstract protected function walkBackends($id, $method, $parameters);
/** /**
@ -95,6 +100,9 @@ abstract class Proxy {
return unserialize(base64_decode($this->cache->get($key))); return unserialize(base64_decode($this->cache->get($key)));
} }
/**
* @param string $key
*/
public function isCached($key) { public function isCached($key) {
$key = $this->getCacheKey($key); $key = $this->getCacheKey($key);
return $this->cache->hasKey($key); return $this->cache->hasKey($key);

View File

@ -865,8 +865,8 @@ class Wizard extends LDAPUtility {
/** /**
* @brief does a cumulativeSearch on LDAP to get different values of a * @brief does a cumulativeSearch on LDAP to get different values of a
* specified attribute * specified attribute
* @param $filters array, the filters that shall be used in the search * @param string[] $filters array, the filters that shall be used in the search
* @param $attr the attribute of which a list of values shall be returned * @param string $attr the attribute of which a list of values shall be returned
* @param $lfw bool, whether the last filter is a wildcard which shall not * @param $lfw bool, whether the last filter is a wildcard which shall not
* be processed if there were already findings, defaults to true * be processed if there were already findings, defaults to true
* @param string $maxF string. if not null, this variable will have the filter that * @param string $maxF string. if not null, this variable will have the filter that
@ -933,8 +933,8 @@ class Wizard extends LDAPUtility {
* @brief determines if and which $attr are available on the LDAP server * @brief determines if and which $attr are available on the LDAP server
* @param string[] $objectclasses the objectclasses to use as search filter * @param string[] $objectclasses the objectclasses to use as search filter
* @param string $attr the attribute to look for * @param string $attr the attribute to look for
* @param $dbkey the dbkey of the setting the feature is connected to * @param string $dbkey the dbkey of the setting the feature is connected to
* @param $confkey the confkey counterpart for the $dbkey as used in the * @param string $confkey the confkey counterpart for the $dbkey as used in the
* Configuration class * Configuration class
* @param $po boolean, whether the objectClass with most result entries * @param $po boolean, whether the objectClass with most result entries
* shall be pre-selected via the result * shall be pre-selected via the result

View File

@ -25,7 +25,6 @@
namespace OCA\user_ldap; namespace OCA\user_ldap;
use OCA\user_ldap\lib\ILDAPWrapper;
use OCA\user_ldap\lib\BackendUtility; use OCA\user_ldap\lib\BackendUtility;
class USER_LDAP extends BackendUtility implements \OCP\UserInterface { class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
@ -139,7 +138,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
* @brief reads the image from LDAP that shall be used as Avatar * @brief reads the image from LDAP that shall be used as Avatar
* @param $uid string, the ownCloud user name * @param $uid string, the ownCloud user name
* @param $dn string, the user DN * @param $dn string, the user DN
* @return image data (provided by LDAP) | false * @return string data (provided by LDAP) | false
*/ */
private function getAvatarImage($uid, $dn) { private function getAvatarImage($uid, $dn) {
$attributes = array('jpegPhoto', 'thumbnailPhoto'); $attributes = array('jpegPhoto', 'thumbnailPhoto');

View File

@ -11,7 +11,6 @@ namespace OC\Core\Command\Db;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class GenerateChangeScript extends Command { class GenerateChangeScript extends Command {

View File

@ -9,9 +9,7 @@
namespace OC\Core\Command; namespace OC\Core\Command;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class Status extends Command { class Status extends Command {

View File

@ -10,9 +10,7 @@ namespace OC\Core\Command;
use OC\Updater; use OC\Updater;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
class Upgrade extends Command { class Upgrade extends Command {

View File

@ -9,10 +9,8 @@
namespace OC\Core\Command\User; namespace OC\Core\Command\User;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Helper\TableHelper;
class Report extends Command { class Report extends Command {
protected function configure() { protected function configure() {

View File

@ -640,6 +640,8 @@ class OC_App{
/** /**
* register an admin form to be shown * register an admin form to be shown
* @param string $app
* @param string $page
*/ */
public static function registerAdmin($app, $page) { public static function registerAdmin($app, $page) {
self::$adminForms[]= $app.'/'.$page.'.php'; self::$adminForms[]= $app.'/'.$page.'.php';

View File

@ -69,6 +69,9 @@ class AppConfig implements \OCP\IAppConfig {
return $this->cache[$app]; return $this->cache[$app];
} }
/**
* @param string $app
*/
private function getAppValues($app) { private function getAppValues($app) {
$appCache = $this->getAppCache($app); $appCache = $this->getAppCache($app);
if (array_search($app, $this->appsLoaded) === false) { if (array_search($app, $this->appsLoaded) === false) {
@ -184,7 +187,7 @@ class AppConfig implements \OCP\IAppConfig {
* @brief Deletes a key * @brief Deletes a key
* @param string $app app * @param string $app app
* @param string $key key * @param string $key key
* @return bool * @return boolean|null
*/ */
public function deleteKey($app, $key) { public function deleteKey($app, $key) {
$where = array( $where = array(
@ -200,7 +203,7 @@ class AppConfig implements \OCP\IAppConfig {
/** /**
* @brief Remove app from appconfig * @brief Remove app from appconfig
* @param string $app app * @param string $app app
* @return bool * @return boolean|null
* *
* Removes all keys in appconfig belonging to the app. * Removes all keys in appconfig belonging to the app.
*/ */

View File

@ -25,7 +25,6 @@
namespace OC\AppFramework; namespace OC\AppFramework;
use OC\AppFramework\DependencyInjection\DIContainer; use OC\AppFramework\DependencyInjection\DIContainer;
use OCP\AppFramework\IAppContainer;
/** /**

View File

@ -34,7 +34,6 @@ use OC\AppFramework\Utility\SimpleContainer;
use OC\AppFramework\Utility\TimeFactory; use OC\AppFramework\Utility\TimeFactory;
use OCP\AppFramework\IApi; use OCP\AppFramework\IApi;
use OCP\AppFramework\IAppContainer; use OCP\AppFramework\IAppContainer;
use OCP\AppFramework\IMiddleWare;
use OCP\AppFramework\Middleware; use OCP\AppFramework\Middleware;
use OCP\IServerContainer; use OCP\IServerContainer;

View File

@ -24,8 +24,8 @@
namespace OC\AppFramework\Http; namespace OC\AppFramework\Http;
use OCP\AppFramework\Http\Response, use OCP\AppFramework\Http\Response;
OCP\AppFramework\Http; use OCP\AppFramework\Http;
/** /**

View File

@ -26,7 +26,6 @@ namespace OC\AppFramework\Middleware;
use OCP\AppFramework\Controller; use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Response; use OCP\AppFramework\Http\Response;
use OCP\AppFramework\MiddleWare;
/** /**
* This class is used to store and run all the middleware in correct order * This class is used to store and run all the middleware in correct order

View File

@ -66,7 +66,7 @@ class SecurityMiddleware extends Middleware {
* This runs all the security checks before a method call. The * This runs all the security checks before a method call. The
* security checks are determined by inspecting the controller method * security checks are determined by inspecting the controller method
* annotations * annotations
* @param string/Controller $controller the controllername or string * @param string $controller the controllername or string
* @param string $methodName the name of the method * @param string $methodName the name of the method
* @throws SecurityException when a security check fails * @throws SecurityException when a security check fails
*/ */

View File

@ -88,7 +88,6 @@ abstract class OC_Archive{
abstract function extractFile($path, $dest); abstract function extractFile($path, $dest);
/** /**
* extract the archive * extract the archive
* @param string $path
* @param string $dest * @param string $dest
* @return bool * @return bool
*/ */

View File

@ -22,6 +22,9 @@ class OC_Archive_TAR extends OC_Archive{
private $tar=null; private $tar=null;
private $path; private $path;
/**
* @param string $source
*/
function __construct($source) { function __construct($source) {
$types=array(null, 'gz', 'bz'); $types=array(null, 'gz', 'bz');
$this->path=$source; $this->path=$source;
@ -122,6 +125,9 @@ class OC_Archive_TAR extends OC_Archive{
return true; return true;
} }
/**
* @param string $file
*/
private function getHeader($file) { private function getHeader($file) {
if ( ! $this->cachedHeaders ) { if ( ! $this->cachedHeaders ) {
$this->cachedHeaders = $this->tar->listContent(); $this->cachedHeaders = $this->tar->listContent();

View File

@ -13,6 +13,9 @@ class OC_Archive_ZIP extends OC_Archive{
private $zip=null; private $zip=null;
private $path; private $path;
/**
* @param string $source
*/
function __construct($source) { function __construct($source) {
$this->path=$source; $this->path=$source;
$this->zip=new ZipArchive(); $this->zip=new ZipArchive();
@ -125,7 +128,6 @@ class OC_Archive_ZIP extends OC_Archive{
} }
/** /**
* extract the archive * extract the archive
* @param string $path
* @param string $dest * @param string $dest
* @return bool * @return bool
*/ */

View File

@ -39,6 +39,9 @@ class ArrayParser {
return $this->parse($string); return $this->parse($string);
} }
/**
* @param string $string
*/
function stripPHPTags($string) { function stripPHPTags($string) {
$string = trim($string); $string = trim($string);
if (substr($string, 0, 5) === '<?php') { if (substr($string, 0, 5) === '<?php') {

View File

@ -38,7 +38,7 @@ class OC_BackgroundJob{
/** /**
* @brief sets the background jobs execution type * @brief sets the background jobs execution type
* @param string $type execution type * @param string $type execution type
* @return boolean|null * @return false|null
* *
* This method sets the execution type of the background jobs. Possible types * This method sets the execution type of the background jobs. Possible types
* are "none", "ajax", "webcron", "cron" * are "none", "ajax", "webcron", "cron"

View File

@ -31,7 +31,7 @@ class JobList implements IJobList {
} }
/** /**
* @param Job|string $job * @param \Test\BackgroundJob\TestJob $job
* @param mixed $argument * @param mixed $argument
*/ */
public function add($job, $argument = null) { public function add($job, $argument = null) {

View File

@ -35,7 +35,7 @@ class UserCache implements \OCP\ICache {
* Set a value in the user cache * Set a value in the user cache
* *
* @param string $key * @param string $key
* @param mixed $value * @param string $value
* @param int $ttl Time To Live in seconds. Defaults to 60*60*24 * @param int $ttl Time To Live in seconds. Defaults to 60*60*24
* @return bool * @return bool
*/ */

View File

@ -77,7 +77,7 @@ class Config {
/** /**
* @brief Gets a value from config.php * @brief Gets a value from config.php
* @param string $key key * @param string $key key
* @param mixed $default = null default value * @param string|null $default = null default value
* @return string the value or $default * @return string the value or $default
* *
* This function gets the value from config.php. If it does not exist, * This function gets the value from config.php. If it does not exist,
@ -94,7 +94,7 @@ class Config {
/** /**
* @brief Sets a value * @brief Sets a value
* @param string $key key * @param string $key key
* @param mixed $value value * @param string $value value
* *
* This function sets the value and writes the config.php. * This function sets the value and writes the config.php.
* *

View File

@ -47,7 +47,7 @@ class OC_Connector_Sabre_AbortedUploadDetectionPlugin extends Sabre_DAV_ServerPl
} }
/** /**
* @param $filePath * @param string $filePath
* @param Sabre_DAV_INode $node * @param Sabre_DAV_INode $node
* @throws Sabre_DAV_Exception_BadRequest * @throws Sabre_DAV_Exception_BadRequest
*/ */

View File

@ -46,6 +46,7 @@ class OC_Connector_Sabre_QuotaPlugin extends Sabre_DAV_ServerPlugin {
* This method is called before any HTTP method and validates there is enough free space to store the file * This method is called before any HTTP method and validates there is enough free space to store the file
* *
* @throws Sabre_DAV_Exception * @throws Sabre_DAV_Exception
* @param string $uri
* @return bool * @return bool
*/ */
public function checkQuota($uri, $data = null) { public function checkQuota($uri, $data = null) {

View File

@ -252,7 +252,7 @@ class OC_DB {
* an array with 'sql' and optionally 'limit' and 'offset' keys * an array with 'sql' and optionally 'limit' and 'offset' keys
* .. or a simple sql query string * .. or a simple sql query string
* @param array $parameters * @param array $parameters
* @return result * @return OC_DB_StatementWrapper
* @throws DatabaseException * @throws DatabaseException
*/ */
static public function executeAudited( $stmt, array $parameters = null) { static public function executeAudited( $stmt, array $parameters = null) {
@ -315,6 +315,7 @@ class OC_DB {
* @brief Insert a row if a matching row doesn't exists. * @brief Insert a row if a matching row doesn't exists.
* @param string $table. The table to insert into in the form '*PREFIX*tableName' * @param string $table. The table to insert into in the form '*PREFIX*tableName'
* @param array $input. An array of fieldname/value pairs * @param array $input. An array of fieldname/value pairs
* @param string $table
* @return boolean number of updated rows * @return boolean number of updated rows
*/ */
public static function insertIfNotExist($table, $input) { public static function insertIfNotExist($table, $input) {

View File

@ -51,6 +51,9 @@ class OC_DB_MDB2SchemaWriter {
} }
} }
/**
* @param SimpleXMLElement $xml
*/
private static function saveColumn($column, $xml) { private static function saveColumn($column, $xml) {
$xml->addChild('name', $column->getName()); $xml->addChild('name', $column->getName());
switch($column->getType()) { switch($column->getType()) {
@ -114,6 +117,9 @@ class OC_DB_MDB2SchemaWriter {
} }
} }
/**
* @param SimpleXMLElement $xml
*/
private static function saveIndex($index, $xml) { private static function saveIndex($index, $xml) {
$xml->addChild('name', $index->getName()); $xml->addChild('name', $index->getName());
if ($index->isPrimary()) { if ($index->isPrimary()) {

View File

@ -41,7 +41,7 @@ class OC_FileChunking {
* Stores the given $data under the given $key - the number of stored bytes is returned * Stores the given $data under the given $key - the number of stored bytes is returned
* *
* @param string $index * @param string $index
* @param $data * @param resource $data
* @return int * @return int
*/ */
public function store($index, $data) { public function store($index, $data) {

View File

@ -110,6 +110,7 @@ class OC_FileProxy{
/** /**
* @param string $operation * @param string $operation
* @param string|boolean $path
* *
* @return string * @return string
*/ */

View File

@ -32,6 +32,9 @@ class OC_Files {
return \OC\Files\Filesystem::getFileInfo($path, $includeMountPoints); return \OC\Files\Filesystem::getFileInfo($path, $includeMountPoints);
} }
/**
* @param string $path
*/
static public function getDirectoryContent($path){ static public function getDirectoryContent($path){
return \OC\Files\Filesystem::getDirectoryContent($path); return \OC\Files\Filesystem::getDirectoryContent($path);
} }

View File

@ -8,8 +8,6 @@
namespace OC\Files\Cache; namespace OC\Files\Cache;
use OCP\Util;
/** /**
* listen to filesystem hooks and change the cache accordingly * listen to filesystem hooks and change the cache accordingly
*/ */

View File

@ -29,6 +29,10 @@ class FileInfo implements \OCP\Files\FileInfo, \ArrayAccess {
*/ */
private $internalPath; private $internalPath;
/**
* @param string|boolean $path
* @param Storage\Storage $storage
*/
public function __construct($path, $storage, $internalPath, $data) { public function __construct($path, $storage, $internalPath, $data) {
$this->path = $path; $this->path = $path;
$this->storage = $storage; $this->storage = $storage;

View File

@ -668,6 +668,9 @@ class Filesystem {
return self::$defaultInstance->search($query); return self::$defaultInstance->search($query);
} }
/**
* @param string $query
*/
static public function searchByMime($query) { static public function searchByMime($query) {
return self::$defaultInstance->searchByMime($query); return self::$defaultInstance->searchByMime($query);
} }

View File

@ -9,7 +9,6 @@
namespace OC\Files\Node; namespace OC\Files\Node;
use OC\Files\Cache\Cache; use OC\Files\Cache\Cache;
use OC\Files\Cache\Scanner;
use OCP\Files\NotFoundException; use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException; use OCP\Files\NotPermittedException;

View File

@ -8,8 +8,6 @@
namespace OC\Files\Node; namespace OC\Files\Node;
use OC\Files\Cache\Cache;
use OC\Files\Cache\Scanner;
use OCP\Files\NotFoundException; use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException; use OCP\Files\NotPermittedException;

View File

@ -9,7 +9,6 @@
namespace OC\Files\Node; namespace OC\Files\Node;
use OC\Files\Cache\Cache; use OC\Files\Cache\Cache;
use OC\Files\Cache\Scanner;
use OC\Files\Mount\Manager; use OC\Files\Mount\Manager;
use OC\Files\Mount\Mount; use OC\Files\Mount\Mount;
use OCP\Files\NotFoundException; use OCP\Files\NotFoundException;

View File

@ -33,6 +33,9 @@ class Loader {
return $this->wrap($mountPoint, new $class($arguments)); return $this->wrap($mountPoint, new $class($arguments));
} }
/**
* @param string|boolean $mountPoint
*/
public function wrap($mountPoint, $storage) { public function wrap($mountPoint, $storage) {
foreach ($this->storageWrappers as $wrapper) { foreach ($this->storageWrappers as $wrapper) {
$storage = $wrapper($mountPoint, $storage); $storage = $wrapper($mountPoint, $storage);

View File

@ -326,12 +326,18 @@ class MappedLocal extends \OC\Files\Storage\Common{
return $this->filemtime($path)>$time; return $this->filemtime($path)>$time;
} }
/**
* @param string $path
*/
private function buildPath($path, $create=true) { private function buildPath($path, $create=true) {
$path = $this->stripLeading($path); $path = $this->stripLeading($path);
$fullPath = $this->datadir.$path; $fullPath = $this->datadir.$path;
return $this->mapper->logicToPhysical($fullPath, $create); return $this->mapper->logicToPhysical($fullPath, $create);
} }
/**
* @param string $path
*/
private function cleanMapper($path, $isLogicPath=true, $recursive=true) { private function cleanMapper($path, $isLogicPath=true, $recursive=true) {
$fullPath = $path; $fullPath = $path;
if ($isLogicPath) { if ($isLogicPath) {

View File

@ -69,6 +69,9 @@ class Scanner extends PublicEmitter {
}); });
} }
/**
* @param string $dir
*/
public function backgroundScan($dir) { public function backgroundScan($dir) {
$mounts = $this->getMounts($dir); $mounts = $this->getMounts($dir);
foreach ($mounts as $mount) { foreach ($mounts as $mount) {

View File

@ -12,6 +12,10 @@ class OC_Geo{
* @param (string) $longitude - Longitude * @param (string) $longitude - Longitude
* @return (string) $timezone - closest timezone * @return (string) $timezone - closest timezone
*/ */
/**
* @param integer $latitude
* @param integer $longitude
*/
public static function timezone($latitude, $longitude) { public static function timezone($latitude, $longitude) {
$alltimezones = DateTimeZone::listIdentifiers(); $alltimezones = DateTimeZone::listIdentifiers();
$variances = array(); $variances = array();

View File

@ -243,7 +243,7 @@ class OC_Group {
/** /**
* @brief get a list of all users in several groups * @brief get a list of all users in several groups
* @param array $gids * @param string[] $gids
* @param string $search * @param string $search
* @param int $limit * @param int $limit
* @param int $offset * @param int $offset

View File

@ -28,7 +28,7 @@ class OC_Group_Dummy extends OC_Group_Backend {
private $groups=array(); private $groups=array();
/** /**
* @brief Try to create a new group * @brief Try to create a new group
* @param $gid The name of the group to create * @param string $gid The name of the group to create
* @returns true/false * @returns true/false
* *
* Trys to create a new group. If the group name already exists, false will * Trys to create a new group. If the group name already exists, false will

View File

@ -34,7 +34,7 @@ class OC_Image {
/** /**
* @brief Get mime type for an image file. * @brief Get mime type for an image file.
* @param $filepath The path to a local image file. * @param string|null $filepath The path to a local image file.
* @returns string The mime type if the it could be determined, otherwise an empty string. * @returns string The mime type if the it could be determined, otherwise an empty string.
*/ */
static public function getMimeTypeForFile($filePath) { static public function getMimeTypeForFile($filePath) {
@ -163,6 +163,7 @@ class OC_Image {
/** /**
* @brief Saves the image. * @brief Saves the image.
* @returns bool * @returns bool
* @param string $filePath
*/ */
public function save($filePath=null) { public function save($filePath=null) {
@ -704,7 +705,7 @@ class OC_Image {
/** /**
* @brief Resizes the image preserving ratio. * @brief Resizes the image preserving ratio.
* @param integer $maxsize The maximum size of either the width or height. * @param integer $maxSize The maximum size of either the width or height.
* @returns bool * @returns bool
*/ */
public function resize($maxSize) { public function resize($maxSize) {
@ -852,8 +853,8 @@ class OC_Image {
/** /**
* @brief Resizes the image to fit within a boundry while preserving ratio. * @brief Resizes the image to fit within a boundry while preserving ratio.
* @param $maxWidth * @param integer $maxWidth
* @param $maxHeight * @param integer $maxHeight
* @returns bool * @returns bool
*/ */
public function fitIn($maxWidth, $maxHeight) { public function fitIn($maxWidth, $maxHeight) {

View File

@ -154,7 +154,7 @@ class OC_Installer{
}else{ }else{
$version = trim($info['version']); $version = trim($info['version']);
} }
if($version<>trim($data['appdata']['version'])) { if($version<>trim($data['appdata']['version'])) {
OC_Helper::rmdirr($extractDir); OC_Helper::rmdirr($extractDir);
throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store")); throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store"));
@ -236,7 +236,6 @@ class OC_Installer{
/** /**
* @brief Update an application * @brief Update an application
* @param array $data with all information
* *
* This function installs an app. All information needed are passed in the * This function installs an app. All information needed are passed in the
* associative array $data. * associative array $data.
@ -270,7 +269,6 @@ class OC_Installer{
/** /**
* @brief Check if an update for the app is available * @brief Check if an update for the app is available
* @param string $name name of the application
* @return string|false false or the version number of the update * @return string|false false or the version number of the update
* *
* The function will check if an update for a version is available * The function will check if an update for a version is available
@ -316,7 +314,7 @@ class OC_Installer{
* @brief Removes an app * @brief Removes an app
* @param string $name name of the application to remove * @param string $name name of the application to remove
* @param $options array with options * @param $options array with options
* @return boolean * @return boolean|null
* *
* This function removes an app. $options is an associative array. The * This function removes an app. $options is an associative array. The
* following keys are optional:ja * following keys are optional:ja

View File

@ -99,6 +99,9 @@ class OC_L10N implements \OCP\IL10N {
$this->lang = $lang; $this->lang = $lang;
} }
/**
* @param string $transFile
*/
public function load($transFile) { public function load($transFile) {
$this->app = true; $this->app = true;
include $transFile; include $transFile;

View File

@ -118,6 +118,8 @@ class OC_Appconfig {
* *
* @param app * @param app
* @param key * @param key
* @param string|false $app
* @param string|false $key
* @return array * @return array
*/ */
public static function getValues($app, $key) { public static function getValues($app, $key) {

View File

@ -41,7 +41,7 @@ class OC_Preferences{
/** /**
* @brief Get all apps of a user * @brief Get all apps of a user
* @param string $user user * @param string $user user
* @return array with app ids * @return integer[] with app ids
* *
* This function returns a list of all apps of the user that have at least * This function returns a list of all apps of the user that have at least
* one entry in the preferences table. * one entry in the preferences table.

View File

@ -431,6 +431,7 @@ class OC_Migrate{
/** /**
* @brief connects to migration.db, or creates if not found * @brief connects to migration.db, or creates if not found
* @param $db optional path to migration.db, defaults to user data dir * @param $db optional path to migration.db, defaults to user data dir
* @param string $path
* @return bool whether the operation was successful * @return bool whether the operation was successful
*/ */
static private function connectDB( $path=null ) { static private function connectDB( $path=null ) {
@ -460,7 +461,7 @@ class OC_Migrate{
/** /**
* @brief creates the tables in migration.db from an apps database.xml * @brief creates the tables in migration.db from an apps database.xml
* @param $appid string id of the app * @param string $appid string id of the app
* @return bool whether the operation was successful * @return bool whether the operation was successful
*/ */
static private function createAppTables( $appid ) { static private function createAppTables( $appid ) {

View File

@ -34,9 +34,9 @@ class OC_Migration_Content{
/** /**
* @brief sets up the * @brief sets up the
* @param $zip ZipArchive object * @param ZipArchive $zip ZipArchive object
* @param $db a database object (required for exporttype user) * @param $db a database object (required for exporttype user)
* @return bool * @return boolean|null
*/ */
public function __construct( $zip, $db=null ) { public function __construct( $zip, $db=null ) {
@ -74,7 +74,7 @@ class OC_Migration_Content{
/** /**
* @brief processes the db query * @brief processes the db query
* @param $query the query to process * @param string $query the query to process
* @return string of processed query * @return string of processed query
*/ */
private function processQuery( $query ) { private function processQuery( $query ) {
@ -130,7 +130,7 @@ class OC_Migration_Content{
/** /**
* @brief saves a sql data set into migration.db * @brief saves a sql data set into migration.db
* @param $data a sql data set returned from self::prepare()->query() * @param OC_DB_StatementWrapper $data a sql data set returned from self::prepare()->query()
* @param $options array of copyRows options * @param $options array of copyRows options
* @return void * @return void
*/ */

View File

@ -30,7 +30,7 @@ abstract class OC_Migration_Provider{
/** /**
* @brief sets the OC_Migration_Content object to $this->content * @brief sets the OC_Migration_Content object to $this->content
* @param $content a OC_Migration_Content object * @param OC_Migration_Content $content a OC_Migration_Content object
*/ */
public function setData( $uid, $content, $info=null ) { public function setData( $uid, $content, $info=null ) {
$this->content = $content; $this->content = $content;

View File

@ -23,9 +23,6 @@
* *
*/ */
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
/** /**
* Class to handle open collaboration services API requests * Class to handle open collaboration services API requests
* *
@ -38,7 +35,7 @@ class OC_OCS {
* @param string $method HTTP method to read the key from * @param string $method HTTP method to read the key from
* @param string $key Parameter to read * @param string $key Parameter to read
* @param string $type Variable type to format data * @param string $type Variable type to format data
* @param mixed $default Default value to return if the key is not found * @param string $default Default value to return if the key is not found
* @return string Data or if the key is not found and no default is set it will exit with a 400 Bad request * @return string Data or if the key is not found and no default is set it will exit with a 400 Bad request
*/ */
public static function readData($method, $key, $type = 'raw', $default = null) { public static function readData($method, $key, $type = 'raw', $default = null) {

View File

@ -111,7 +111,7 @@ class Preferences {
/** /**
* @brief Get all apps of an user * @brief Get all apps of an user
* @param string $user user * @param string $user user
* @return array with app ids * @return integer[] with app ids
* *
* This function returns a list of all apps of the user that have at least * This function returns a list of all apps of the user that have at least
* one entry in the preferences table. * one entry in the preferences table.

View File

@ -192,7 +192,7 @@ class OC_Request {
/** /**
* @brief Check if the requestor understands gzip * @brief Check if the requestor understands gzip
* @return boolean true for gzip encoding supported * @return false|string true for gzip encoding supported
*/ */
static public function acceptGZip() { static public function acceptGZip() {
if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) { if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {

View File

@ -15,8 +15,8 @@ class SearchResultSorter {
private $log; private $log;
/** /**
* @param $search the search term as was given by the user * @param string $search the search term as was given by the user
* @param $key the array key containing the value that should be compared * @param string $key the array key containing the value that should be compared
* against * against
* @param $encoding optional, encoding to use, defaults to UTF-8 * @param $encoding optional, encoding to use, defaults to UTF-8
* @param $log optional, an \OC\Log instance * @param $log optional, an \OC\Log instance

View File

@ -30,6 +30,8 @@ class Base {
/** /**
* @param string $serverroot * @param string $serverroot
* @param string|false $app_dir * @param string|false $app_dir
* @param string $theme
* @param string $app
*/ */
protected function getAppTemplateDirs($theme, $app, $serverroot, $app_dir) { protected function getAppTemplateDirs($theme, $app, $serverroot, $app_dir) {
// Check if the app is in the app folder or in the root // Check if the app is in the app folder or in the root
@ -47,6 +49,7 @@ class Base {
/** /**
* @param string $serverroot * @param string $serverroot
* @param string $theme
*/ */
protected function getCoreTemplateDirs($theme, $serverroot) { protected function getCoreTemplateDirs($theme, $serverroot) {
return array( return array(
@ -119,6 +122,7 @@ class Base {
/** /**
* @brief doing the actual work * @brief doing the actual work
* @param string $file
* @return string content * @return string content
* *
* Includes the template file, fetches its output * Includes the template file, fetches its output

View File

@ -15,6 +15,7 @@ class TemplateFileLocator {
/** /**
* @param string[] $dirs * @param string[] $dirs
* @param string $form_factor
*/ */
public function __construct( $form_factor, $dirs ) { public function __construct( $form_factor, $dirs ) {
$this->form_factor = $form_factor; $this->form_factor = $form_factor;

View File

@ -516,6 +516,8 @@ class OC_User {
* @returns array with all uids * @returns array with all uids
* *
* Get a list of all users. * Get a list of all users.
* @param integer $limit
* @param integer $offset
*/ */
public static function getUsers($search = '', $limit = null, $offset = null) { public static function getUsers($search = '', $limit = null, $offset = null) {
$users = self::getManager()->search($search, $limit, $offset); $users = self::getManager()->search($search, $limit, $offset);

View File

@ -256,7 +256,7 @@ class OC_User_Database extends OC_User_Backend {
/** /**
* counts the users in the database * counts the users in the database
* *
* @return int | bool * @return false|string | bool
*/ */
public function countUsers() { public function countUsers() {
$query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`'); $query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`');

View File

@ -218,7 +218,7 @@ class OC_Util {
* @brief add a javascript file * @brief add a javascript file
* *
* @param string $application * @param string $application
* @param mixed $file filename * @param string|null $file filename
* @return void * @return void
*/ */
public static function addScript( $application, $file = null ) { public static function addScript( $application, $file = null ) {
@ -237,7 +237,7 @@ class OC_Util {
* @brief add a css file * @brief add a css file
* *
* @param string $application * @param string $application
* @param mixed $file filename * @param string|null $file filename
* @return void * @return void
*/ */
public static function addStyle( $application, $file = null ) { public static function addStyle( $application, $file = null ) {
@ -570,6 +570,7 @@ class OC_Util {
/** /**
* @brief Check if the app is enabled, redirects to home if not * @brief Check if the app is enabled, redirects to home if not
* @param string $app
* @return void * @return void
*/ */
public static function checkAppEnabled($app) { public static function checkAppEnabled($app) {

View File

@ -68,7 +68,7 @@ abstract class Controller {
* 1. URL parameters * 1. URL parameters
* 2. POST parameters * 2. POST parameters
* 3. GET 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 * @return mixed the content of the array
*/ */
public function params($key, $default=null){ public function params($key, $default=null){
@ -131,7 +131,7 @@ abstract class Controller {
* @param array $params the template parameters in key => value structure * @param array $params the template parameters in key => value structure
* @param string $renderAs user renders a full page, blank only your template * @param string $renderAs user renders a full page, blank only your template
* admin an entry in the admin settings * 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 * @return \OCP\AppFramework\Http\TemplateResponse containing the page
*/ */
public function render($templateName, array $params=array(), public function render($templateName, array $params=array(),

View File

@ -59,7 +59,7 @@ class BackgroundJob {
* sets the background jobs execution type * sets the background jobs execution type
* *
* @param string $type execution type * @param string $type execution type
* @return boolean|null * @return false|null
* *
* This method sets the execution type of the background jobs. Possible types * This method sets the execution type of the background jobs. Possible types
* are "none", "ajax", "webcron", "cron" * are "none", "ajax", "webcron", "cron"
@ -115,7 +115,7 @@ class BackgroundJob {
* @deprecated * @deprecated
* Gets one queued task * Gets one queued task
* @param int $id ID of the task * @param int $id ID of the task
* @return \OC\BackgroundJob\Job|null array * @return BackgroundJob\IJob array
*/ */
public static function findQueuedTask($id) { public static function findQueuedTask($id) {
$jobList = \OC::$server->getJobList(); $jobList = \OC::$server->getJobList();

View File

@ -14,6 +14,7 @@ interface IJob {
* *
* @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job * @param \OCP\BackgroundJob\IJobList $jobList The job list that manages the state of this job
* @param \OC\Log $logger * @param \OC\Log $logger
* @return void
*/ */
public function execute($jobList, $logger = null); public function execute($jobList, $logger = null);

View File

@ -14,14 +14,17 @@ interface IJobList {
* *
* @param \OCP\BackgroundJob\IJob |string $job * @param \OCP\BackgroundJob\IJob |string $job
* @param mixed $argument The argument to be passed to $job->run() when the job is exectured * @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); public function add($job, $argument = null);
/** /**
* Remove a job from the list * Remove a job from the list
* *
* @param \OCP\BackgroundJob\IJob|string $job * @param IJob $job
* @param mixed $argument * @param mixed $argument
* @return void
*/ */
public function remove($job, $argument = null); public function remove($job, $argument = null);
@ -58,6 +61,7 @@ interface IJobList {
* set the job that was last ran to the current time * set the job that was last ran to the current time
* *
* @param \OCP\BackgroundJob\IJob $job * @param \OCP\BackgroundJob\IJob $job
* @return void
*/ */
public function setLastJob($job); public function setLastJob($job);
@ -72,6 +76,7 @@ interface IJobList {
* set the lastRun of $job to now * set the lastRun of $job to now
* *
* @param \OCP\BackgroundJob\IJob $job * @param \OCP\BackgroundJob\IJob $job
* @return void
*/ */
public function setLastRun($job); public function setLastRun($job);
} }

View File

@ -96,7 +96,7 @@ namespace OCP\Contacts {
* This function can be used to delete the contact identified by the given id * This function can be used to delete the contact identified by the given id
* *
* @param object $id the unique identifier to a contact * @param object $id the unique identifier to a contact
* @param $address_book_key * @param $address_book_key
* @return bool successful or not * @return bool successful or not
*/ */
function delete($id, $address_book_key); 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. * 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 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 * @return array representing the contact just created or updated
*/ */
function createOrUpdate($properties, $address_book_key); function createOrUpdate($properties, $address_book_key);

View File

@ -37,7 +37,6 @@ namespace OCP;
class Files { class Files {
/** /**
* Recusive deletion of folders * Recusive deletion of folders
* @param string $path to the folder
* @return bool * @return bool
*/ */
static function rmdirr( $dir ) { static function rmdirr( $dir ) {

View File

@ -57,6 +57,7 @@ interface IAppConfig {
* *
* @param app * @param app
* @param key * @param key
* @param string $key
* @return array * @return array
*/ */
public function getValues($app, $key); public function getValues($app, $key);
@ -68,6 +69,7 @@ interface IAppConfig {
* @param string $value value * @param string $value value
* *
* Sets a value. If the key did not exist before it will be created. * Sets a value. If the key did not exist before it will be created.
* @return void
*/ */
public function setValue($app, $key, $value); public function setValue($app, $key, $value);

View File

@ -47,7 +47,7 @@ interface IConfig {
* Looks up a system wide defined value * Looks up a system wide defined value
* *
* @param string $key the key of the value, under which it was saved * @param string $key the key of the value, under which it was saved
* @param mixed $default the default value to be returned if the value isn't set * @param string $default the default value to be returned if the value isn't set
* @return string the saved value * @return string the saved value
*/ */
public function getSystemValue($key, $default = ''); public function getSystemValue($key, $default = '');

View File

@ -147,7 +147,7 @@ interface ITags {
* Creates a tag/object relation. * Creates a tag/object relation.
* *
* @param int $objid The id of the object * @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. * @return boolean Returns false on database error.
*/ */
public function tagAs($objid, $tag); public function tagAs($objid, $tag);
@ -156,7 +156,7 @@ interface ITags {
* Delete single tag/object relation from the db * Delete single tag/object relation from the db
* *
* @param int $objid The id of the object * @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 * @return boolean
*/ */
public function unTag($objid, $tag); public function unTag($objid, $tag);

View File

@ -78,6 +78,9 @@ class Share {
* @param string Backend class * @param string Backend class
* @param string (optional) Depends on item type * @param string (optional) Depends on item type
* @param array (optional) List of supported file extensions if this item type depends on files * @param array (optional) List of supported file extensions if this item type depends on files
* @param string $itemType
* @param string $class
* @param string $collectionOf
* @return boolean true if backend is registered or false if error * @return boolean true if backend is registered or false if error
*/ */
public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) { public static function registerBackend($itemType, $class, $collectionOf = null, $supportedFileExtensions = null) {
@ -404,6 +407,7 @@ class Share {
* @param mixed Parameters * @param mixed Parameters
* @param int Number of items to return (optional) Returns all by default * @param int Number of items to return (optional) Returns all by default
* @param bool include collections * @param bool include collections
* @param string $itemType
* @return Return depends on format * @return Return depends on format
*/ */
public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null, public static function getItemsShared($itemType, $format = self::FORMAT_NONE, $parameters = null,
@ -662,6 +666,8 @@ class Share {
* Unshare an item from all users, groups, and remove all links * Unshare an item from all users, groups, and remove all links
* @param string Item type * @param string Item type
* @param string Item source * @param string Item source
* @param string $itemType
* @param string $itemSource
* @return boolean true on success or false on failure * @return boolean true on success or false on failure
*/ */
public static function unshareAll($itemType, $itemSource) { public static function unshareAll($itemType, $itemSource) {
@ -694,6 +700,8 @@ class Share {
* Unshare an item shared with the current user * Unshare an item shared with the current user
* @param string Item type * @param string Item type
* @param string Item target * @param string Item target
* @param string $itemType
* @param string $itemTarget
* @return boolean true on success or false on failure * @return boolean true on success or false on failure
* *
* Unsharing from self is not allowed for items inside collections * Unsharing from self is not allowed for items inside collections
@ -1630,6 +1638,7 @@ class Share {
* @param string User that is the owner of shared item * @param string User that is the owner of shared item
* @param string The suggested target originating from a reshare (optional) * @param string The suggested target originating from a reshare (optional)
* @param int The id of the parent group share (optional) * @param int The id of the parent group share (optional)
* @param integer $shareType
* @return string Item target * @return string Item target
*/ */
private static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner, private static function generateTarget($itemType, $itemSource, $shareType, $shareWith, $uidOwner,
@ -1937,6 +1946,8 @@ interface Share_Backend {
* Get the source of the item to be stored in the database * Get the source of the item to be stored in the database
* @param string Item source * @param string Item source
* @param string Owner of the item * @param string Owner of the item
* @param string $itemSource
* @param string $uidOwner
* @return boolean Source * @return boolean Source
* *
* Return an array if the item is file dependent, the array needs two keys: 'item' and 'file' * Return an array if the item is file dependent, the array needs two keys: 'item' and 'file'
@ -1993,6 +2004,8 @@ interface Share_Backend_File_Dependent extends Share_Backend {
* Get the file path of the item * Get the file path of the item
* @param string Item source * @param string Item source
* @param string User that is the owner of shared item * @param string User that is the owner of shared item
* @param string $itemSource
* @param string $uidOwner
* @return boolean * @return boolean
*/ */
public function getFilePath($itemSource, $uidOwner); public function getFilePath($itemSource, $uidOwner);

View File

@ -9,6 +9,10 @@
class Test_API extends PHPUnit_Framework_TestCase { class Test_API extends PHPUnit_Framework_TestCase {
// Helps build a response variable // Helps build a response variable
/**
* @param string $message
*/
function buildResponse($shipped, $data, $code, $message=null) { function buildResponse($shipped, $data, $code, $message=null) {
return array( return array(
'shipped' => $shipped, 'shipped' => $shipped,
@ -18,6 +22,10 @@ class Test_API extends PHPUnit_Framework_TestCase {
} }
// Validate details of the result // Validate details of the result
/**
* @param OC_OCS_Result $result
*/
function checkResult($result, $success) { function checkResult($result, $success) {
// Check response is of correct type // Check response is of correct type
$this->assertInstanceOf('OC_OCS_Result', $result); $this->assertInstanceOf('OC_OCS_Result', $result);

View File

@ -24,7 +24,6 @@
namespace OC\AppFramework\Http; namespace OC\AppFramework\Http;
use OC\AppFramework\Core\API;
use OC\AppFramework\Middleware\MiddlewareDispatcher; use OC\AppFramework\Middleware\MiddlewareDispatcher;
use OCP\AppFramework\Http; use OCP\AppFramework\Http;
//require_once(__DIR__ . "/../classloader.php"); //require_once(__DIR__ . "/../classloader.php");
@ -78,6 +77,10 @@ class DispatcherTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @param string $out
* @param string $httpHeaders
*/
private function setMiddlewareExpections($out=null, private function setMiddlewareExpections($out=null,
$httpHeaders=null, $responseHeaders=array(), $httpHeaders=null, $responseHeaders=array(),
$ex=false, $catchEx=true) { $ex=false, $catchEx=true) {

View File

@ -25,8 +25,8 @@
namespace OC\AppFramework\Http; namespace OC\AppFramework\Http;
use OCP\AppFramework\Http\Response, use OCP\AppFramework\Http\Response;
OCP\AppFramework\Http; use OCP\AppFramework\Http;
class ResponseTest extends \PHPUnit_Framework_TestCase { class ResponseTest extends \PHPUnit_Framework_TestCase {

View File

@ -50,6 +50,9 @@ class TestMiddleware extends Middleware {
private $beforeControllerThrowsEx; private $beforeControllerThrowsEx;
/**
* @param boolean $beforeControllerThrowsEx
*/
public function __construct($beforeControllerThrowsEx) { public function __construct($beforeControllerThrowsEx) {
self::$beforeControllerCalled = 0; self::$beforeControllerCalled = 0;
self::$afterControllerCalled = 0; self::$afterControllerCalled = 0;

View File

@ -58,6 +58,9 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @param string $method
*/
private function checkNavEntry($method){ private function checkNavEntry($method){
$api = $this->getAPI(); $api = $this->getAPI();
@ -79,6 +82,10 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @param string $method
* @param string $test
*/
private function ajaxExceptionStatus($method, $test, $status) { private function ajaxExceptionStatus($method, $test, $status) {
$api = $this->getAPI(); $api = $this->getAPI();
$api->expects($this->any()) $api->expects($this->any())
@ -183,6 +190,10 @@ class SecurityMiddlewareTest extends \PHPUnit_Framework_TestCase {
} }
/**
* @param string $method
* @param string $expects
*/
private function securityCheck($method, $expects, $shouldFail=false){ private function securityCheck($method, $expects, $shouldFail=false){
$api = $this->getAPI(); $api = $this->getAPI();
$api->expects($this->once()) $api->expects($this->once())

View File

@ -78,6 +78,13 @@ class RouteConfigTest extends \PHPUnit_Framework_TestCase
$this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountId'); $this->assertResource($routes, 'admin_accounts', '/admin/accounts', 'AdminAccountsController', 'adminAccountId');
} }
/**
* @param string $name
* @param string $verb
* @param string $url
* @param string $controllerName
* @param string $actionName
*/
private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName) private function assertSimpleRoute($routes, $name, $verb, $url, $controllerName, $actionName)
{ {
// route mocks // route mocks
@ -100,6 +107,12 @@ class RouteConfigTest extends \PHPUnit_Framework_TestCase
$config->register(); $config->register();
} }
/**
* @param string $resourceName
* @param string $url
* @param string $controllerName
* @param string $paramName
*/
private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName) private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName)
{ {
// router mock // router mock

View File

@ -111,10 +111,16 @@ class Test_DBSchema extends PHPUnit_Framework_TestCase {
} }
} }
/**
* @param string $table
*/
public function assertTableExist($table) { public function assertTableExist($table) {
$this->assertTrue($this->tableExist($table), 'Table ' . $table . ' does not exist'); $this->assertTrue($this->tableExist($table), 'Table ' . $table . ' does not exist');
} }
/**
* @param string $table
*/
public function assertTableNotExist($table) { public function assertTableNotExist($table) {
$type=OC_Config::getValue( "dbtype", "sqlite" ); $type=OC_Config::getValue( "dbtype", "sqlite" );
if( $type == 'sqlite' || $type == 'sqlite3' ) { if( $type == 'sqlite' || $type == 'sqlite3' ) {

View File

@ -56,6 +56,10 @@ class Test_ErrorHandler extends \PHPUnit_Framework_TestCase {
* @brief dummy class to access protected methods of \OC\Log\ErrorHandler * @brief dummy class to access protected methods of \OC\Log\ErrorHandler
*/ */
class TestableErrorHandler extends \OC\Log\ErrorHandler { class TestableErrorHandler extends \OC\Log\ErrorHandler {
/**
* @param string $msg
*/
public static function testRemovePassword($msg) { public static function testRemovePassword($msg) {
return self::removePassword($msg); return self::removePassword($msg);
} }

View File

@ -19,6 +19,10 @@ class DummyUser extends \OC\User\User {
*/ */
private $uid; private $uid;
/**
* @param string $uid
* @param string $home
*/
public function __construct($uid, $home) { public function __construct($uid, $home) {
$this->home = $home; $this->home = $home;
$this->uid = $uid; $this->uid = $uid;

View File

@ -68,6 +68,9 @@ class EtagTest extends \PHPUnit_Framework_TestCase {
$this->assertEquals($originalEtags, $this->getEtags($files)); $this->assertEquals($originalEtags, $this->getEtags($files));
} }
/**
* @param string[] $files
*/
private function getEtags($files) { private function getEtags($files) {
$etags = array(); $etags = array();
foreach ($files as $file) { foreach ($files as $file) {

View File

@ -9,10 +9,7 @@
namespace Test\Files\Node; namespace Test\Files\Node;
use OC\Files\Cache\Cache; use OC\Files\Cache\Cache;
use OC\Files\Mount\Manager;
use OC\Files\Node\Root; use OC\Files\Node\Root;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use OC\Files\Storage\Temporary; use OC\Files\Storage\Temporary;
use OC\Files\View; use OC\Files\View;
use OC\User\User; use OC\User\User;

View File

@ -8,7 +8,6 @@
namespace Test\Files\Node; namespace Test\Files\Node;
use OC\Files\Cache\Cache;
use OCP\Files\NotPermittedException; use OCP\Files\NotPermittedException;
use OC\Files\Mount\Manager; use OC\Files\Mount\Manager;

View File

@ -29,6 +29,10 @@ class DummyUser extends User {
private $uid; private $uid;
/**
* @param string $uid
* @param string $home
*/
public function __construct($uid, $home) { public function __construct($uid, $home) {
$this->uid = $uid; $this->uid = $uid;
$this->home = $home; $this->home = $home;

View File

@ -27,6 +27,9 @@ class Quota extends \Test\Files\Storage\Storage {
\OC_Helper::rmdirr($this->tmpDir); \OC_Helper::rmdirr($this->tmpDir);
} }
/**
* @param integer $limit
*/
protected function getLimitedStorage($limit) { protected function getLimitedStorage($limit) {
$storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir)); $storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
$storage->getScanner()->scan(''); $storage->getScanner()->scan('');

View File

@ -13,6 +13,10 @@ class Quota extends \PHPUnit_Framework_TestCase {
\OC\Files\Stream\Quota::clear(); \OC\Files\Stream\Quota::clear();
} }
/**
* @param string $mode
* @param integer $limit
*/
protected function getStream($mode, $limit) { protected function getStream($mode, $limit) {
$source = fopen('php://temp', $mode); $source = fopen('php://temp', $mode);
return \OC\Files\Stream\Quota::wrap($source, $limit); return \OC\Files\Stream\Quota::wrap($source, $limit);

View File

@ -29,7 +29,7 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase {
/** /**
* get a new unique group name * get a new unique group name
* test cases can override this in order to clean up created groups * test cases can override this in order to clean up created groups
* @return array * @return string
*/ */
public function getGroupName() { public function getGroupName() {
return uniqid('test_'); return uniqid('test_');
@ -38,7 +38,7 @@ abstract class Test_Group_Backend extends PHPUnit_Framework_TestCase {
/** /**
* get a new unique user name * get a new unique user name
* test cases can override this in order to clean up created user * test cases can override this in order to clean up created user
* @return array * @return string
*/ */
public function getUserName() { public function getUserName() {
return uniqid('test_'); return uniqid('test_');

View File

@ -26,7 +26,7 @@ class Test_Group_Database extends Test_Group_Backend {
/** /**
* get a new unique group name * get a new unique group name
* test cases can override this in order to clean up created groups * test cases can override this in order to clean up created groups
* @return array * @return string
*/ */
public function getGroupName() { public function getGroupName() {
$name=uniqid('test_'); $name=uniqid('test_');
@ -37,7 +37,7 @@ class Test_Group_Database extends Test_Group_Backend {
/** /**
* get a new unique user name * get a new unique user name
* test cases can override this in order to clean up created user * test cases can override this in order to clean up created user
* @return array * @return string
*/ */
public function getUserName() { public function getUserName() {
return uniqid('test_'); return uniqid('test_');

View File

@ -13,7 +13,7 @@ use OC\User\User;
class Group extends \PHPUnit_Framework_TestCase { class Group extends \PHPUnit_Framework_TestCase {
/** /**
* @return \PHPUnit_Framework_MockObject_MockObject | \OC\User\Manager * @return \OC\User\Manager | \OC\User\Manager
*/ */
protected function getUserManager() { protected function getUserManager() {
$userManager = $this->getMock('\OC\User\Manager'); $userManager = $this->getMock('\OC\User\Manager');

View File

@ -31,6 +31,7 @@ class Test_Migrate extends PHPUnit_Framework_TestCase {
* @brief checks for existence of export_info.json and file folder * @brief checks for existence of export_info.json and file folder
* @param string $exportedUser the user that was exported * @param string $exportedUser the user that was exported
* @param string $path the path to the .zip export * @param string $path the path to the .zip export
* @param string $exportedBy
*/ */
public function validateUserExport($exportedBy, $exportedUser, $path) { public function validateUserExport($exportedBy, $exportedUser, $path) {
$this->assertTrue(file_exists($path)); $this->assertTrue(file_exists($path));

View File

@ -131,6 +131,7 @@ class Test_OC_OCS_Privatedata extends PHPUnit_Framework_TestCase
/** /**
* @param \OC_OCS_Result $result * @param \OC_OCS_Result $result
* @param integer $expectedArraySize
*/ */
public function assertOcsResult($expectedArraySize, $result) { public function assertOcsResult($expectedArraySize, $result) {
$this->assertEquals(100, $result->getStatusCode()); $this->assertEquals(100, $result->getStatusCode());

View File

@ -151,6 +151,10 @@ class Test_Share extends PHPUnit_Framework_TestCase {
); );
} }
/**
* @param string $sharer
* @param string $receiver
*/
protected function shareUserTestFileWithUser($sharer, $receiver) { protected function shareUserTestFileWithUser($sharer, $receiver) {
OC_User::setUserId($sharer); OC_User::setUserId($sharer);
$this->assertTrue( $this->assertTrue(
@ -558,6 +562,9 @@ class Test_Share extends PHPUnit_Framework_TestCase {
); );
} }
/**
* @param boolean|string $token
*/
protected function getShareByValidToken($token) { protected function getShareByValidToken($token) {
$row = OCP\Share::getShareByToken($token); $row = OCP\Share::getShareByToken($token);
$this->assertInternalType( $this->assertInternalType(

View File

@ -7,6 +7,11 @@
*/ */
class Test_ResourceLocator extends PHPUnit_Framework_TestCase { class Test_ResourceLocator extends PHPUnit_Framework_TestCase {
/**
* @param string $theme
* @param string $form_factor
*/
public function getResourceLocator( $theme, $form_factor, $core_map, $party_map, $appsroots ) { public function getResourceLocator( $theme, $form_factor, $core_map, $party_map, $appsroots ) {
return $this->getMockForAbstractClass('OC\Template\ResourceLocator', return $this->getMockForAbstractClass('OC\Template\ResourceLocator',
array( $theme, $form_factor, $core_map, $party_map, $appsroots ), array( $theme, $form_factor, $core_map, $party_map, $appsroots ),

View File

@ -9,8 +9,6 @@
namespace Test; namespace Test;
use OC\Hooks\PublicEmitter;
class User extends \PHPUnit_Framework_TestCase { class User extends \PHPUnit_Framework_TestCase {
/** /**
* @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend * @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend

Some files were not shown because too many files have changed in this diff Show More