/**
* @brief glob uses different pattern than regular expressions, escape glob pattern only
* @param string $path unescaped path
- * @return escaped path
+ * @return string path
*/
public static function escapeGlobPattern($path) {
return preg_replace('/(\*|\?|\[)/', '[$1]', $path);
/**
* Get the Google_DriveFile object for the specified path
* @param string $path
- * @return Google_DriveFile|false
+ * @return string
*/
private function getDriveFile($path) {
// Remove leading and trailing slashes
abstract class StreamWrapper extends Common {
/**
+ * @param string $path
* @return string|null
*/
abstract public function constructUrl($path);
}
}
+ /**
+ * @param string $path
+ */
public function cleanPath($path) {
$path = \OC\Files\Filesystem::normalizePath($path);
// remove leading slash
* 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
*
- * @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() {
return false;
/**
* @brief Get the source file path, permissions, and owner for a shared file
* @param string Shared target file path
+ * @param string $target
* @return Returns array with the keys path, permissions, and owner or false if not found
*/
public function getFile($target) {
* @brief deletes used space for files versions in db if user was deleted
*
* @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) {
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_versions` WHERE `user`=?');
/**
* @brief get list of files we want to expire
- * @param integer $currentTime timestamp of current time
* @param array $versions list of versions
+ * @param integer $time
* @return array containing the list of to deleted versions and the size of them
*/
protected static function getExpireList($time, $versions) {
/**
* gives back the database table for the query
+ * @param boolean $isUser
*/
private function getMapTable($isUser) {
if($isUser) {
* @brief executes an LDAP search, optimized for Users
* @param $filter the LDAP filter for the search
* @param $attr optional, when a certain attribute shall be filtered out
+ * @param integer $limit
+ * @param integer $offset
* @returns array with the search result
*
* Executes an LDAP search
/**
* @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 integer $limit
+ * @param integer $offset
* @returns array with the search result
*
* Executes an LDAP search
/**
* @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 $attr optional, array, one or more attributes that shall be
* retrieved. Results will according to the order in the array.
return $this->combineFilterWithOr($filter);
}
+ /**
+ * @param string $password
+ */
public function areCredentialsValid($name, $password) {
$name = $this->DNasBaseParameter($name);
$testConnection = clone $this->connection;
return unserialize(base64_decode($this->cache->get($key)));
}
+ /**
+ * @param string $key
+ */
public function isCached($key) {
if(!$this->configured) {
$this->readConfiguration();
/**
* @param boolean $passOnWhen
+ * @param string $method
*/
abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen);
+
+ /**
+ * @param string $method
+ */
abstract protected function walkBackends($id, $method, $parameters);
/**
return unserialize(base64_decode($this->cache->get($key)));
}
+ /**
+ * @param string $key
+ */
public function isCached($key) {
$key = $this->getCacheKey($key);
return $this->cache->hasKey($key);
/**
* @brief does a cumulativeSearch on LDAP to get different values of a
* specified attribute
- * @param $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[] $filters array, the filters that shall be used in the search
+ * @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
* be processed if there were already findings, defaults to true
* @param string $maxF string. if not null, this variable will have the filter that
* @brief determines if and which $attr are available on the LDAP server
* @param string[] $objectclasses the objectclasses to use as search filter
* @param string $attr the attribute to look for
- * @param $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 $dbkey the dbkey of the setting the feature is connected to
+ * @param string $confkey the confkey counterpart for the $dbkey as used in the
* Configuration class
* @param $po boolean, whether the objectClass with most result entries
* shall be pre-selected via the result
namespace OCA\user_ldap;
-use OCA\user_ldap\lib\ILDAPWrapper;
use OCA\user_ldap\lib\BackendUtility;
class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
* @brief reads the image from LDAP that shall be used as Avatar
* @param $uid string, the ownCloud user name
* @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) {
$attributes = array('jpegPhoto', 'thumbnailPhoto');
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateChangeScript extends Command {
namespace OC\Core\Command;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Status extends Command {
use OC\Updater;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
-use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Upgrade extends Command {
namespace OC\Core\Command\User;
use Symfony\Component\Console\Command\Command;
-use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
-use Symfony\Component\Console\Helper\TableHelper;
class Report extends Command {
protected function configure() {
/**
* register an admin form to be shown
+ * @param string $app
+ * @param string $page
*/
public static function registerAdmin($app, $page) {
self::$adminForms[]= $app.'/'.$page.'.php';
return $this->cache[$app];
}
+ /**
+ * @param string $app
+ */
private function getAppValues($app) {
$appCache = $this->getAppCache($app);
if (array_search($app, $this->appsLoaded) === false) {
* @brief Deletes a key
* @param string $app app
* @param string $key key
- * @return bool
+ * @return boolean|null
*/
public function deleteKey($app, $key) {
$where = array(
/**
* @brief Remove app from appconfig
* @param string $app app
- * @return bool
+ * @return boolean|null
*
* Removes all keys in appconfig belonging to the app.
*/
namespace OC\AppFramework;
use OC\AppFramework\DependencyInjection\DIContainer;
-use OCP\AppFramework\IAppContainer;
/**
use OC\AppFramework\Utility\TimeFactory;
use OCP\AppFramework\IApi;
use OCP\AppFramework\IAppContainer;
-use OCP\AppFramework\IMiddleWare;
use OCP\AppFramework\Middleware;
use OCP\IServerContainer;
namespace OC\AppFramework\Http;
-use OCP\AppFramework\Http\Response,
- OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Response;
+use OCP\AppFramework\Http;
/**
use OCP\AppFramework\Controller;
use OCP\AppFramework\Http\Response;
-use OCP\AppFramework\MiddleWare;
/**
* This class is used to store and run all the middleware in correct order
* This runs all the security checks before a method call. The
* security checks are determined by inspecting the controller method
* annotations
- * @param string/Controller $controller the controllername or string
+ * @param string $controller the controllername or string
* @param string $methodName the name of the method
* @throws SecurityException when a security check fails
*/
abstract function extractFile($path, $dest);
/**
* extract the archive
- * @param string $path
* @param string $dest
* @return bool
*/
private $tar=null;
private $path;
+ /**
+ * @param string $source
+ */
function __construct($source) {
$types=array(null, 'gz', 'bz');
$this->path=$source;
return true;
}
+ /**
+ * @param string $file
+ */
private function getHeader($file) {
if ( ! $this->cachedHeaders ) {
$this->cachedHeaders = $this->tar->listContent();
private $zip=null;
private $path;
+ /**
+ * @param string $source
+ */
function __construct($source) {
$this->path=$source;
$this->zip=new ZipArchive();
}
/**
* extract the archive
- * @param string $path
* @param string $dest
* @return bool
*/
return $this->parse($string);
}
+ /**
+ * @param string $string
+ */
function stripPHPTags($string) {
$string = trim($string);
if (substr($string, 0, 5) === '<?php') {
/**
* @brief sets the background jobs 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
* are "none", "ajax", "webcron", "cron"
}
/**
- * @param Job|string $job
+ * @param \Test\BackgroundJob\TestJob $job
* @param mixed $argument
*/
public function add($job, $argument = null) {
* Set a value in the user cache
*
* @param string $key
- * @param mixed $value
+ * @param string $value
* @param int $ttl Time To Live in seconds. Defaults to 60*60*24
* @return bool
*/
/**
* @brief Gets a value from config.php
* @param string $key key
- * @param mixed $default = null default value
+ * @param string|null $default = null default value
* @return string the value or $default
*
* This function gets the value from config.php. If it does not exist,
/**
* @brief Sets a value
* @param string $key key
- * @param mixed $value value
+ * @param string $value value
*
* This function sets the value and writes the config.php.
*
}
/**
- * @param $filePath
+ * @param string $filePath
* @param Sabre_DAV_INode $node
* @throws Sabre_DAV_Exception_BadRequest
*/
* This method is called before any HTTP method and validates there is enough free space to store the file
*
* @throws Sabre_DAV_Exception
+ * @param string $uri
* @return bool
*/
public function checkQuota($uri, $data = null) {
* an array with 'sql' and optionally 'limit' and 'offset' keys
* .. or a simple sql query string
* @param array $parameters
- * @return result
+ * @return OC_DB_StatementWrapper
* @throws DatabaseException
*/
static public function executeAudited( $stmt, array $parameters = null) {
* @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 array $input. An array of fieldname/value pairs
+ * @param string $table
* @return boolean number of updated rows
*/
public static function insertIfNotExist($table, $input) {
}
}
+ /**
+ * @param SimpleXMLElement $xml
+ */
private static function saveColumn($column, $xml) {
$xml->addChild('name', $column->getName());
switch($column->getType()) {
}
}
+ /**
+ * @param SimpleXMLElement $xml
+ */
private static function saveIndex($index, $xml) {
$xml->addChild('name', $index->getName());
if ($index->isPrimary()) {
* Stores the given $data under the given $key - the number of stored bytes is returned
*
* @param string $index
- * @param $data
+ * @param resource $data
* @return int
*/
public function store($index, $data) {
/**
* @param string $operation
+ * @param string|boolean $path
*
* @return string
*/
return \OC\Files\Filesystem::getFileInfo($path, $includeMountPoints);
}
+ /**
+ * @param string $path
+ */
static public function getDirectoryContent($path){
return \OC\Files\Filesystem::getDirectoryContent($path);
}
namespace OC\Files\Cache;
-use OCP\Util;
-
/**
* listen to filesystem hooks and change the cache accordingly
*/
*/
private $internalPath;
+ /**
+ * @param string|boolean $path
+ * @param Storage\Storage $storage
+ */
public function __construct($path, $storage, $internalPath, $data) {
$this->path = $path;
$this->storage = $storage;
return self::$defaultInstance->search($query);
}
+ /**
+ * @param string $query
+ */
static public function searchByMime($query) {
return self::$defaultInstance->searchByMime($query);
}
namespace OC\Files\Node;
use OC\Files\Cache\Cache;
-use OC\Files\Cache\Scanner;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
namespace OC\Files\Node;
-use OC\Files\Cache\Cache;
-use OC\Files\Cache\Scanner;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
namespace OC\Files\Node;
use OC\Files\Cache\Cache;
-use OC\Files\Cache\Scanner;
use OC\Files\Mount\Manager;
use OC\Files\Mount\Mount;
use OCP\Files\NotFoundException;
return $this->wrap($mountPoint, new $class($arguments));
}
+ /**
+ * @param string|boolean $mountPoint
+ */
public function wrap($mountPoint, $storage) {
foreach ($this->storageWrappers as $wrapper) {
$storage = $wrapper($mountPoint, $storage);
return $this->filemtime($path)>$time;
}
+ /**
+ * @param string $path
+ */
private function buildPath($path, $create=true) {
$path = $this->stripLeading($path);
$fullPath = $this->datadir.$path;
return $this->mapper->logicToPhysical($fullPath, $create);
}
+ /**
+ * @param string $path
+ */
private function cleanMapper($path, $isLogicPath=true, $recursive=true) {
$fullPath = $path;
if ($isLogicPath) {
});
}
+ /**
+ * @param string $dir
+ */
public function backgroundScan($dir) {
$mounts = $this->getMounts($dir);
foreach ($mounts as $mount) {
* @param (string) $longitude - Longitude
* @return (string) $timezone - closest timezone
*/
+ /**
+ * @param integer $latitude
+ * @param integer $longitude
+ */
public static function timezone($latitude, $longitude) {
$alltimezones = DateTimeZone::listIdentifiers();
$variances = array();
/**
* @brief get a list of all users in several groups
- * @param array $gids
+ * @param string[] $gids
* @param string $search
* @param int $limit
* @param int $offset
private $groups=array();
/**
* @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
*
* Trys to create a new group. If the group name already exists, false will
/**
* @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.
*/
static public function getMimeTypeForFile($filePath) {
/**
* @brief Saves the image.
* @returns bool
+ * @param string $filePath
*/
public function save($filePath=null) {
/**
* @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
*/
public function resize($maxSize) {
/**
* @brief Resizes the image to fit within a boundry while preserving ratio.
- * @param $maxWidth
- * @param $maxHeight
+ * @param integer $maxWidth
+ * @param integer $maxHeight
* @returns bool
*/
public function fitIn($maxWidth, $maxHeight) {
/**
* @brief Update an application
- * @param array $data with all information
- *
- * This function installs an app. All information needed are passed in the
- * associative array $data.
- * The following keys are required:
- * - source: string, can be "path" or "http"
- *
- * One of the following keys is required:
- * - path: path to the file containing the app
- * - href: link to the downloadable file containing the app
- *
- * The following keys are optional:
- * - pretend: boolean, if set true the system won't do anything
- * - noupgrade: boolean, if true appinfo/upgrade.php won't be loaded
- *
- * This function works as follows
- * -# fetching the file
- * -# removing the old files
- * -# unzipping new file
- * -# including appinfo/upgrade.php
- * -# setting the installed version
- *
- * upgrade.php can determine the current installed version of the app using
- * "OC_Appconfig::getValue($appid, 'installed_version')"
*/
public static function updateApp( $app ) {
$ocsid=OC_Appconfig::getValue( $app, 'ocsid');
/**
* @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
*
* The function will check if an update for a version is available
* @brief Removes an app
* @param string $name name of the application to remove
* @param $options array with options
- * @return boolean
+ * @return boolean|null
*
* This function removes an app. $options is an associative array. The
* following keys are optional:ja
$this->lang = $lang;
}
+ /**
+ * @param string $transFile
+ */
public function load($transFile) {
$this->app = true;
include $transFile;
*
* @param app
* @param key
+ * @param string|false $app
+ * @param string|false $key
* @return array
*/
public static function getValues($app, $key) {
/**
* @brief Get all apps of a 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
* one entry in the preferences table.
/**
* @brief connects to migration.db, or creates if not found
* @param $db optional path to migration.db, defaults to user data dir
+ * @param string $path
* @return bool whether the operation was successful
*/
static private function connectDB( $path=null ) {
/**
* @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
*/
static private function createAppTables( $appid ) {
/**
* @brief sets up the
- * @param $zip ZipArchive object
+ * @param ZipArchive $zip ZipArchive object
* @param $db a database object (required for exporttype user)
- * @return bool
+ * @return boolean|null
*/
public function __construct( $zip, $db=null ) {
/**
* @brief processes the db query
- * @param $query the query to process
+ * @param string $query the query to process
* @return string of processed query
*/
private function processQuery( $query ) {
/**
* @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
* @return void
*/
/**
* @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 ) {
$this->content = $content;
*
*/
-use Symfony\Component\Routing\Exception\ResourceNotFoundException;
-use Symfony\Component\Routing\Exception\MethodNotAllowedException;
-
/**
* Class to handle open collaboration services API requests
*
* @param string $method HTTP method to read the key from
* @param string $key Parameter to read
* @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
*/
public static function readData($method, $key, $type = 'raw', $default = null) {
/**
* @brief Get all apps of an 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
* one entry in the preferences table.
/**
* @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() {
if (!isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
private $log;
/**
- * @param $search the search term as was given by the user
- * @param $key the array key containing the value that should be compared
+ * @param string $search the search term as was given by the user
+ * @param string $key the array key containing the value that should be compared
* against
* @param $encoding optional, encoding to use, defaults to UTF-8
* @param $log optional, an \OC\Log instance
/**
* @param string $serverroot
* @param string|false $app_dir
+ * @param string $theme
+ * @param string $app
*/
protected function getAppTemplateDirs($theme, $app, $serverroot, $app_dir) {
// Check if the app is in the app folder or in the root
/**
* @param string $serverroot
+ * @param string $theme
*/
protected function getCoreTemplateDirs($theme, $serverroot) {
return array(
/**
* @brief doing the actual work
+ * @param string $file
* @return string content
*
* Includes the template file, fetches its output
/**
* @param string[] $dirs
+ * @param string $form_factor
*/
public function __construct( $form_factor, $dirs ) {
$this->form_factor = $form_factor;
* @returns array with all uids
*
* Get a list of all users.
+ * @param integer $limit
+ * @param integer $offset
*/
public static function getUsers($search = '', $limit = null, $offset = null) {
$users = self::getManager()->search($search, $limit, $offset);
/**
* counts the users in the database
*
- * @return int | bool
+ * @return false|string | bool
*/
public function countUsers() {
$query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`');
* @brief add a javascript file
*
* @param string $application
- * @param mixed $file filename
+ * @param string|null $file filename
* @return void
*/
public static function addScript( $application, $file = null ) {
* @brief add a css file
*
* @param string $application
- * @param mixed $file filename
+ * @param string|null $file filename
* @return void
*/
public static function addStyle( $application, $file = null ) {
/**
* @brief Check if the app is enabled, redirects to home if not
+ * @param string $app
* @return void
*/
public static function checkAppEnabled($app) {
* 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){
* @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(),
* sets the background jobs 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
* are "none", "ajax", "webcron", "cron"
* @deprecated
* Gets one queued task
* @param int $id ID of the task
- * @return \OC\BackgroundJob\Job|null array
+ * @return BackgroundJob\IJob array
*/
public static function findQueuedTask($id) {
$jobList = \OC::$server->getJobList();
*
* @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);
*
* @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 \OCP\BackgroundJob\IJob|string $job
+ * @param IJob $job
* @param mixed $argument
+ * @return void
*/
public function remove($job, $argument = null);
* set the job that was last ran to the current time
*
* @param \OCP\BackgroundJob\IJob $job
+ * @return void
*/
public function setLastJob($job);
* set the lastRun of $job to now
*
* @param \OCP\BackgroundJob\IJob $job
+ * @return void
*/
public function setLastRun($job);
}
* 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);
* 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);
class Files {
/**
* Recusive deletion of folders
- * @param string $path to the folder
* @return bool
*/
static function rmdirr( $dir ) {
*
* @param app
* @param key
+ * @param string $key
* @return array
*/
public function getValues($app, $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);
* Looks up a system wide defined value
*
* @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
*/
public function getSystemValue($key, $default = '');
* 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);
* 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);
* @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
+ * @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) {
* @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,
* Unshare an item from all users, groups, and remove all links
* @param string Item type
* @param string Item source
+ * @param string $itemType
+ * @param string $itemSource
* @return boolean true on success or false on failure
*/
public static function unshareAll($itemType, $itemSource) {
* Unshare an item shared with the current user
* @param string Item type
* @param string Item target
+ * @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
* @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,
* Get the source of the item to be stored in the database
* @param string Item source
* @param string Owner of the item
+ * @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'
* 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);
class Test_API extends PHPUnit_Framework_TestCase {
// Helps build a response variable
+
+ /**
+ * @param string $message
+ */
function buildResponse($shipped, $data, $code, $message=null) {
return array(
'shipped' => $shipped,
}
// Validate details of the result
+
+ /**
+ * @param OC_OCS_Result $result
+ */
function checkResult($result, $success) {
// Check response is of correct type
$this->assertInstanceOf('OC_OCS_Result', $result);
namespace OC\AppFramework\Http;
-use OC\AppFramework\Core\API;
use OC\AppFramework\Middleware\MiddlewareDispatcher;
use OCP\AppFramework\Http;
//require_once(__DIR__ . "/../classloader.php");
}
+ /**
+ * @param string $out
+ * @param string $httpHeaders
+ */
private function setMiddlewareExpections($out=null,
$httpHeaders=null, $responseHeaders=array(),
$ex=false, $catchEx=true) {
namespace OC\AppFramework\Http;
-use OCP\AppFramework\Http\Response,
- OCP\AppFramework\Http;
+use OCP\AppFramework\Http\Response;
+use OCP\AppFramework\Http;
class ResponseTest extends \PHPUnit_Framework_TestCase {
private $beforeControllerThrowsEx;
+ /**
+ * @param boolean $beforeControllerThrowsEx
+ */
public function __construct($beforeControllerThrowsEx) {
self::$beforeControllerCalled = 0;
self::$afterControllerCalled = 0;
}
+ /**
+ * @param string $method
+ */
private function checkNavEntry($method){
$api = $this->getAPI();
}
+ /**
+ * @param string $method
+ * @param string $test
+ */
private function ajaxExceptionStatus($method, $test, $status) {
$api = $this->getAPI();
$api->expects($this->any())
}
+ /**
+ * @param string $method
+ * @param string $expects
+ */
private function securityCheck($method, $expects, $shouldFail=false){
$api = $this->getAPI();
$api->expects($this->once())
$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)
{
// route mocks
$config->register();
}
+ /**
+ * @param string $resourceName
+ * @param string $url
+ * @param string $controllerName
+ * @param string $paramName
+ */
private function assertResource($yaml, $resourceName, $url, $controllerName, $paramName)
{
// router mock
}
}
+ /**
+ * @param string $table
+ */
public function assertTableExist($table) {
$this->assertTrue($this->tableExist($table), 'Table ' . $table . ' does not exist');
}
+ /**
+ * @param string $table
+ */
public function assertTableNotExist($table) {
$type=OC_Config::getValue( "dbtype", "sqlite" );
if( $type == 'sqlite' || $type == 'sqlite3' ) {
* @brief dummy class to access protected methods of \OC\Log\ErrorHandler
*/
class TestableErrorHandler extends \OC\Log\ErrorHandler {
+
+ /**
+ * @param string $msg
+ */
public static function testRemovePassword($msg) {
return self::removePassword($msg);
}
*/
private $uid;
+ /**
+ * @param string $uid
+ * @param string $home
+ */
public function __construct($uid, $home) {
$this->home = $home;
$this->uid = $uid;
$this->assertEquals($originalEtags, $this->getEtags($files));
}
+ /**
+ * @param string[] $files
+ */
private function getEtags($files) {
$etags = array();
foreach ($files as $file) {
namespace Test\Files\Node;
use OC\Files\Cache\Cache;
-use OC\Files\Mount\Manager;
use OC\Files\Node\Root;
-use OCP\Files\NotFoundException;
-use OCP\Files\NotPermittedException;
use OC\Files\Storage\Temporary;
use OC\Files\View;
use OC\User\User;
namespace Test\Files\Node;
-use OC\Files\Cache\Cache;
use OCP\Files\NotPermittedException;
use OC\Files\Mount\Manager;
private $uid;
+ /**
+ * @param string $uid
+ * @param string $home
+ */
public function __construct($uid, $home) {
$this->uid = $uid;
$this->home = $home;
\OC_Helper::rmdirr($this->tmpDir);
}
+ /**
+ * @param integer $limit
+ */
protected function getLimitedStorage($limit) {
$storage = new \OC\Files\Storage\Local(array('datadir' => $this->tmpDir));
$storage->getScanner()->scan('');
\OC\Files\Stream\Quota::clear();
}
+ /**
+ * @param string $mode
+ * @param integer $limit
+ */
protected function getStream($mode, $limit) {
$source = fopen('php://temp', $mode);
return \OC\Files\Stream\Quota::wrap($source, $limit);
/**
* get a new unique group name
* test cases can override this in order to clean up created groups
- * @return array
+ * @return string
*/
public function getGroupName() {
return uniqid('test_');
/**
* get a new unique user name
* test cases can override this in order to clean up created user
- * @return array
+ * @return string
*/
public function getUserName() {
return uniqid('test_');
/**
* get a new unique group name
* test cases can override this in order to clean up created groups
- * @return array
+ * @return string
*/
public function getGroupName() {
$name=uniqid('test_');
/**
* get a new unique user name
* test cases can override this in order to clean up created user
- * @return array
+ * @return string
*/
public function getUserName() {
return uniqid('test_');
class Group extends \PHPUnit_Framework_TestCase {
/**
- * @return \PHPUnit_Framework_MockObject_MockObject | \OC\User\Manager
+ * @return \OC\User\Manager | \OC\User\Manager
*/
protected function getUserManager() {
$userManager = $this->getMock('\OC\User\Manager');
* @brief checks for existence of export_info.json and file folder
* @param string $exportedUser the user that was exported
* @param string $path the path to the .zip export
+ * @param string $exportedBy
*/
public function validateUserExport($exportedBy, $exportedUser, $path) {
$this->assertTrue(file_exists($path));
/**
* @param \OC_OCS_Result $result
+ * @param integer $expectedArraySize
*/
public function assertOcsResult($expectedArraySize, $result) {
$this->assertEquals(100, $result->getStatusCode());
);
}
+ /**
+ * @param string $sharer
+ * @param string $receiver
+ */
protected function shareUserTestFileWithUser($sharer, $receiver) {
OC_User::setUserId($sharer);
$this->assertTrue(
);
}
+ /**
+ * @param boolean|string $token
+ */
protected function getShareByValidToken($token) {
$row = OCP\Share::getShareByToken($token);
$this->assertInternalType(
*/
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 ) {
return $this->getMockForAbstractClass('OC\Template\ResourceLocator',
array( $theme, $form_factor, $core_map, $party_map, $appsroots ),
namespace Test;
-use OC\Hooks\PublicEmitter;
-
class User extends \PHPUnit_Framework_TestCase {
/**
* @var \OC_User_Backend | \PHPUnit_Framework_MockObject_MockObject $backend
return $this->verbosity === 'detail';
}
+ /**
+ * @param string $dir
+ */
private function unlinkDir($dir) {
if ($dh = @opendir($dir)) {
while (($file = readdir($dh)) !== false) {