polish documentation based on scrutinizer patches

This commit is contained in:
Jörn Friedrich Dreyer 2014-02-06 16:30:58 +01:00
parent 0d94da7e9e
commit 2a6a9a8cef
150 changed files with 649 additions and 219 deletions

View File

@ -635,7 +635,7 @@ class Hooks {
/** /**
* @brief if the file was really deleted we remove the encryption keys * @brief if the file was really deleted we remove the encryption keys
* @param array $params * @param array $params
* @return boolean * @return boolean|null
*/ */
public static function postDelete($params) { public static function postDelete($params) {
@ -675,7 +675,7 @@ class Hooks {
/** /**
* @brief remember the file which should be deleted and it's owner * @brief remember the file which should be deleted and it's owner
* @param array $params * @param array $params
* @return boolean * @return boolean|null
*/ */
public static function preDelete($params) { public static function preDelete($params) {
$path = $params[\OC\Files\Filesystem::signal_param_path]; $path = $params[\OC\Files\Filesystem::signal_param_path];

View File

@ -182,6 +182,7 @@ class Crypt {
* @param $data * @param $data
* @param string $relPath The path of the file, relative to user/data; * @param string $relPath The path of the file, relative to user/data;
* e.g. filename or /Docs/filename, NOT admin/files/filename * e.g. filename or /Docs/filename, NOT admin/files/filename
* @param boolean $isCatFileContent
* @return boolean * @return boolean
*/ */
public static function isLegacyEncryptedContent($isCatFileContent, $relPath) { public static function isLegacyEncryptedContent($isCatFileContent, $relPath) {
@ -209,8 +210,8 @@ class Crypt {
/** /**
* @brief Symmetrically encrypt a string * @brief Symmetrically encrypt a string
* @param $plainContent * @param string $plainContent
* @param $iv * @param string $iv
* @param string $passphrase * @param string $passphrase
* @return string encrypted file content * @return string encrypted file content
*/ */
@ -229,9 +230,9 @@ class Crypt {
/** /**
* @brief Symmetrically decrypt a string * @brief Symmetrically decrypt a string
* @param $encryptedContent * @param string $encryptedContent
* @param $iv * @param string $iv
* @param $passphrase * @param string $passphrase
* @throws \Exception * @throws \Exception
* @return string decrypted file content * @return string decrypted file content
*/ */
@ -292,8 +293,7 @@ class Crypt {
* @brief Symmetrically encrypts a string and returns keyfile content * @brief Symmetrically encrypts a string and returns keyfile content
* @param string $plainContent content to be encrypted in keyfile * @param string $plainContent content to be encrypted in keyfile
* @param string $passphrase * @param string $passphrase
* @return bool|string * @return false|string encrypted content combined with IV
* @return string encrypted content combined with IV
* @note IV need not be specified, as it will be stored in the returned keyfile * @note IV need not be specified, as it will be stored in the returned keyfile
* and remain accessible therein. * and remain accessible therein.
*/ */
@ -326,7 +326,7 @@ class Crypt {
* @param $keyfileContent * @param $keyfileContent
* @param string $passphrase * @param string $passphrase
* @throws \Exception * @throws \Exception
* @return bool|string * @return string|false
* @internal param string $source * @internal param string $source
* @internal param string $target * @internal param string $target
* @internal param string $key the decryption key * @internal param string $key the decryption key
@ -438,7 +438,7 @@ class Crypt {
* @param $encryptedContent * @param $encryptedContent
* @param $shareKey * @param $shareKey
* @param $privateKey * @param $privateKey
* @return bool * @return false|string
* @internal param string $plainContent content to be encrypted * @internal param string $plainContent content to be encrypted
* @returns string $plainContent decrypted string * @returns string $plainContent decrypted string
* @note symmetricDecryptFileContent() can be used to decrypt files created using this method * @note symmetricDecryptFileContent() can be used to decrypt files created using this method

View File

@ -103,7 +103,7 @@ class Helper {
* @brief enable recovery * @brief enable recovery
* *
* @param $recoveryKeyId * @param $recoveryKeyId
* @param $recoveryPassword * @param string $recoveryPassword
* @internal param \OCA\Encryption\Util $util * @internal param \OCA\Encryption\Util $util
* @internal param string $password * @internal param string $password
* @return bool * @return bool
@ -209,7 +209,7 @@ class Helper {
/** /**
* @brief disable recovery * @brief disable recovery
* *
* @param $recoveryPassword * @param string $recoveryPassword
* @return bool * @return bool
*/ */
public static function adminDisableRecovery($recoveryPassword) { public static function adminDisableRecovery($recoveryPassword) {
@ -344,6 +344,7 @@ class Helper {
/** /**
* @brief redirect to a error page * @brief redirect to a error page
* @param Session $session
*/ */
public static function redirectToErrorPage($session, $errorCode = null) { public static function redirectToErrorPage($session, $errorCode = null) {
@ -423,6 +424,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 unescaped path * @param unescaped path
* @param string $path
* @return escaped path * @return escaped path
*/ */
public static function escapeGlobPattern($path) { public static function escapeGlobPattern($path) {
@ -441,7 +443,7 @@ class Helper {
/** /**
* @brief get the path of the original file * @brief get the path of the original file
* @param string $tmpFile path of the tmp file * @param string $tmpFile path of the tmp file
* @return mixed path of the original file or false * @return string|false path of the original file or false
*/ */
public static function getPathFromTmpFile($tmpFile) { public static function getPathFromTmpFile($tmpFile) {
if (isset(self::$tmpFileMapping[$tmpFile])) { if (isset(self::$tmpFileMapping[$tmpFile])) {

View File

@ -170,7 +170,7 @@ class Keymanager {
* @brief retrieve keyfile for an encrypted file * @brief retrieve keyfile for an encrypted file
* @param \OC_FilesystemView $view * @param \OC_FilesystemView $view
* @param \OCA\Encryption\Util $util * @param \OCA\Encryption\Util $util
* @param $filePath * @param string|false $filePath
* @internal param \OCA\Encryption\file $string name * @internal param \OCA\Encryption\file $string name
* @return string file key or false * @return string file key or false
* @note The keyfile returned is asymmetrically encrypted. Decryption * @note The keyfile returned is asymmetrically encrypted. Decryption
@ -513,6 +513,8 @@ class Keymanager {
/** /**
* @brief Make preparations to vars and filesystem for saving a keyfile * @brief Make preparations to vars and filesystem for saving a keyfile
* @param string|boolean $path
* @param string $basePath
*/ */
public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) { public static function keySetPreparation(\OC_FilesystemView $view, $path, $basePath, $userId) {
@ -542,7 +544,7 @@ class Keymanager {
/** /**
* @brief extract filename from share key name * @brief extract filename from share key name
* @param string $shareKey (filename.userid.sharekey) * @param string $shareKey (filename.userid.sharekey)
* @return mixed filename or false * @return string|false filename or false
*/ */
protected static function getFilenameFromShareKey($shareKey) { protected static function getFilenameFromShareKey($shareKey) {
$parts = explode('.', $shareKey); $parts = explode('.', $shareKey);

View File

@ -195,7 +195,7 @@ class Session {
/** /**
* @brief Sets user legacy key to session * @brief Sets user legacy key to session
* @param $legacyKey * @param string $legacyKey
* @return bool * @return bool
*/ */
public function setLegacyKey($legacyKey) { public function setLegacyKey($legacyKey) {

View File

@ -563,7 +563,7 @@ class Util {
/** /**
* @param $path * @param string $path
* @return bool * @return bool
*/ */
public function isSharedPath($path) { public function isSharedPath($path) {
@ -1031,7 +1031,7 @@ class Util {
* @brief Decrypt a keyfile * @brief Decrypt a keyfile
* @param string $filePath * @param string $filePath
* @param string $privateKey * @param string $privateKey
* @return bool|string * @return false|string
*/ */
private function decryptKeyfile($filePath, $privateKey) { private function decryptKeyfile($filePath, $privateKey) {
@ -1110,6 +1110,7 @@ class Util {
/** /**
* @brief Find, sanitise and format users sharing a file * @brief Find, sanitise and format users sharing a file
* @note This wraps other methods into a portable bundle * @note This wraps other methods into a portable bundle
* @param boolean $sharingEnabled
*/ */
public function getSharingUsersArray($sharingEnabled, $filePath, $currentUserId = false) { public function getSharingUsersArray($sharingEnabled, $filePath, $currentUserId = false) {

View File

@ -661,7 +661,7 @@ class Test_Encryption_Crypt extends \PHPUnit_Framework_TestCase {
/** /**
* @brief encryption using legacy blowfish method * @brief encryption using legacy blowfish method
* @param $data string data to encrypt * @param string $data data to encrypt
* @param $passwd string password * @param $passwd string password
* @return string * @return string
*/ */

View File

@ -250,6 +250,10 @@ class Test_Encryption_Keymanager extends \PHPUnit_Framework_TestCase {
* dummy class to access protected methods of \OCA\Encryption\Keymanager for testing * dummy class to access protected methods of \OCA\Encryption\Keymanager for testing
*/ */
class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager { class TestProtectedKeymanagerMethods extends \OCA\Encryption\Keymanager {
/**
* @param string $sharekey
*/
public static function testGetFilenameFromShareKey($sharekey) { public static function testGetFilenameFromShareKey($sharekey) {
return self::getFilenameFromShareKey($sharekey); return self::getFilenameFromShareKey($sharekey);
} }

View File

@ -461,7 +461,7 @@ class Test_Encryption_Util extends \PHPUnit_Framework_TestCase {
* helper function to set migration status to the right value * helper function to set migration status to the right value
* to be able to test the migration path * to be able to test the migration path
* *
* @param $status needed migration status for test * @param integer $status needed migration status for test
* @param $user for which user the status should be set * @param $user for which user the status should be set
* @return boolean * @return boolean
*/ */

View File

@ -54,6 +54,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
*/ */
private $timeout = 15; private $timeout = 15;
/**
* @param string $path
*/
private function normalizePath($path) { private function normalizePath($path) {
$path = trim($path, '/'); $path = trim($path, '/');

View File

@ -35,7 +35,7 @@ class OC_Mount_Config {
* If the configuration parameter is a boolean, add a '!' to the beginning of the value * If the configuration parameter is a boolean, add a '!' to the beginning of the value
* If the configuration parameter is optional, add a '&' to the beginning of the value * If the configuration parameter is optional, add a '&' to the beginning of the value
* If the configuration parameter is hidden, add a '#' to the beginning of the value * If the configuration parameter is hidden, add a '#' to the beginning of the value
* @return array * @return string
*/ */
public static function getBackends() { public static function getBackends() {
@ -269,6 +269,10 @@ class OC_Mount_Config {
* @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER * @param string MOUNT_TYPE_GROUP | MOUNT_TYPE_USER
* @param string User or group to apply mount to * @param string User or group to apply mount to
* @param bool Personal or system mount point i.e. is this being called from the personal or admin page * @param bool Personal or system mount point i.e. is this being called from the personal or admin page
* @param string $mountPoint
* @param string $class
* @param string $mountType
* @param string $applicable
* @return bool * @return bool
*/ */
public static function addMountPoint($mountPoint, public static function addMountPoint($mountPoint,
@ -344,6 +348,7 @@ class OC_Mount_Config {
/** /**
* Read the mount points in the config file into an array * Read the mount points in the config file into an array
* @param bool Personal or system config file * @param bool Personal or system config file
* @param boolean $isPersonal
* @return array * @return array
*/ */
private static function readData($isPersonal) { private static function readData($isPersonal) {
@ -374,6 +379,7 @@ class OC_Mount_Config {
* Write the mount points to the config file * Write the mount points to the config file
* @param bool Personal or system config file * @param bool Personal or system config file
* @param array Mount points * @param array Mount points
* @param boolean $isPersonal
*/ */
private static function writeData($isPersonal, $data) { private static function writeData($isPersonal, $data) {
if ($isPersonal) { if ($isPersonal) {

View File

@ -50,6 +50,9 @@ class Dropbox extends \OC\Files\Storage\Common {
} }
} }
/**
* @param string $path
*/
private function deleteMetaData($path) { private function deleteMetaData($path) {
$path = $this->root.$path; $path = $this->root.$path;
if (isset($this->metaData[$path])) { if (isset($this->metaData[$path])) {
@ -61,7 +64,7 @@ class Dropbox extends \OC\Files\Storage\Common {
/** /**
* @brief Returns the path's metadata * @brief Returns the path's metadata
* @param $path path for which to return the metadata * @param string $path path for which to return the metadata
* @param $list if true, also return the directory's contents * @param $list if true, also return the directory's contents
* @return directory contents if $list is true, file metadata if $list is * @return directory contents if $list is true, file metadata if $list is
* false, null if the file doesn't exist or "false" if the operation failed * false, null if the file doesn't exist or "false" if the operation failed

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 * @return Google_DriveFile|false
*/ */
private function getDriveFile($path) { private function getDriveFile($path) {
// Remove leading and trailing slashes // Remove leading and trailing slashes

View File

@ -134,6 +134,7 @@ class iRODS extends \OC\Files\Storage\StreamWrapper{
/** /**
* get the best guess for the modification time of an iRODS collection * get the best guess for the modification time of an iRODS collection
* @param string $path
*/ */
private function collectionMTime($path) { private function collectionMTime($path) {
$dh = $this->opendir($path); $dh = $this->opendir($path);

View File

@ -75,6 +75,9 @@ class SFTP extends \OC\Files\Storage\Common {
return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root; return 'sftp::' . $this->user . '@' . $this->host . '/' . $this->root;
} }
/**
* @param string $path
*/
private function absPath($path) { private function absPath($path) {
return $this->root . $this->cleanPath($path); return $this->root . $this->cleanPath($path);
} }
@ -277,6 +280,9 @@ class SFTP extends \OC\Files\Storage\Common {
} }
} }
/**
* @param string $path
*/
public function constructUrl($path) { public function constructUrl($path) {
$url = 'sftp://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path; $url = 'sftp://'.$this->user.':'.$this->password.'@'.$this->host.$this->root.$path;
return $url; return $url;

View File

@ -9,6 +9,10 @@
namespace OC\Files\Storage; namespace OC\Files\Storage;
abstract class StreamWrapper extends Common { abstract class StreamWrapper extends Common {
/**
* @return string|null
*/
abstract public function constructUrl($path); abstract public function constructUrl($path);
public function mkdir($path) { public function mkdir($path) {
@ -76,10 +80,17 @@ abstract class StreamWrapper extends Common {
} }
} }
/**
* @param string $path
* @param string $target
*/
public function getFile($path, $target) { public function getFile($path, $target) {
return copy($this->constructUrl($path), $target); return copy($this->constructUrl($path), $target);
} }
/**
* @param string $target
*/
public function uploadFile($path, $target) { public function uploadFile($path, $target) {
return copy($path, $this->constructUrl($target)); return copy($path, $this->constructUrl($target));
} }

View File

@ -52,6 +52,9 @@ class Swift extends \OC\Files\Storage\Common {
*/ */
private static $tmpFiles = array(); private static $tmpFiles = array();
/**
* @param string $path
*/
private function normalizePath($path) { private function normalizePath($path) {
$path = trim($path, '/'); $path = trim($path, '/');
@ -62,6 +65,9 @@ class Swift extends \OC\Files\Storage\Common {
return $path; return $path;
} }
/**
* @param string $path
*/
private function doesObjectExist($path) { private function doesObjectExist($path) {
try { try {
$object = $this->container->DataObject($path); $object = $this->container->DataObject($path);

View File

@ -247,6 +247,10 @@ class DAV extends \OC\Files\Storage\Common{
return true; return true;
} }
/**
* @param string $path
* @param string $target
*/
public function getFile($path, $target) { public function getFile($path, $target) {
$this->init(); $this->init();
$source=$this->fopen($path, 'r'); $source=$this->fopen($path, 'r');
@ -338,6 +342,11 @@ class DAV extends \OC\Files\Storage\Common{
return substr($path, 1); return substr($path, 1);
} }
/**
* @param string $method
* @param string $path
* @param integer $expected
*/
private function simpleResponse($method, $path, $body, $expected) { private function simpleResponse($method, $path, $body, $expected) {
$path=$this->cleanPath($path); $path=$this->cleanPath($path);
try { try {

View File

@ -32,6 +32,9 @@ class Shared_Cache extends Cache {
private $storage; private $storage;
private $files = array(); private $files = array();
/**
* @param \OC\Files\Storage\Shared $storage
*/
public function __construct($storage) { public function __construct($storage) {
$this->storage = $storage; $this->storage = $storage;
} }

View File

@ -42,6 +42,10 @@ class Shared_Permissions extends Permissions {
} }
} }
/**
* @param integer $fileId
* @param string $user
*/
private function getFile($fileId, $user) { private function getFile($fileId, $user) {
if ($fileId == -1) { if ($fileId == -1) {
return \OCP\PERMISSION_READ; return \OCP\PERMISSION_READ;

View File

@ -64,6 +64,7 @@ class Shared extends \OC\Files\Storage\Common {
/** /**
* @brief Get the source file path for a shared file * @brief Get the source file path for a shared file
* @param string Shared target file path * @param string Shared target file path
* @param string $target
* @return string source file path or false if not found * @return string source file path or false if not found
*/ */
public function getSourcePath($target) { public function getSourcePath($target) {

View File

@ -145,6 +145,7 @@ class Test_Files_Sharing_Watcher extends Test_Files_Sharing_Base {
/** /**
* Returns the sizes of the path and its parent dirs in a hash * Returns the sizes of the path and its parent dirs in a hash
* where the key is the path and the value is the size. * where the key is the path and the value is the size.
* @param string $path
*/ */
function getOwnerDirSizes($path) { function getOwnerDirSizes($path) {
$result = array(); $result = array();

View File

@ -61,6 +61,11 @@ class Trashbin {
} }
/**
* @param string $owner
* @param integer $timestamp
* @param string $type
*/
private static function copyFilesToOwner($sourcePath, $owner, $ownerPath, $timestamp, $type, $mime) { private static function copyFilesToOwner($sourcePath, $owner, $ownerPath, $timestamp, $type, $mime) {
self::setUpTrash($owner); self::setUpTrash($owner);
@ -169,7 +174,7 @@ class Trashbin {
* *
* @param $file_path path to original file * @param $file_path path to original file
* @param $filename of deleted file * @param $filename of deleted file
* @param $timestamp when the file was deleted * @param integer $timestamp when the file was deleted
* *
* @return size of stored versions * @return size of stored versions
*/ */
@ -214,7 +219,7 @@ class Trashbin {
* *
* @param $file_path path to original file * @param $file_path path to original file
* @param $filename of deleted file * @param $filename of deleted file
* @param $timestamp when the file was deleted * @param integer $timestamp when the file was deleted
* *
* @return size of encryption keys * @return size of encryption keys
*/ */
@ -406,7 +411,7 @@ class Trashbin {
* @param \OC\Files\View $view file view * @param \OC\Files\View $view file view
* @param $file complete path to file * @param $file complete path to file
* @param $filename name of file once it was deleted * @param $filename name of file once it was deleted
* @param $uniqueFilename new file name to restore the file without overwriting existing files * @param string $uniqueFilename new file name to restore the file without overwriting existing files
* @param $location location if file * @param $location location if file
* @param $timestamp deleteion time * @param $timestamp deleteion time
* *
@ -460,7 +465,7 @@ class Trashbin {
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param $file complete path to file * @param $file complete path to file
* @param $filename name of file * @param $filename name of file
* @param $uniqueFilename new file name to restore the file without overwriting existing files * @param string $uniqueFilename new file name to restore the file without overwriting existing files
* @param $location location of file * @param $location location of file
* @param $timestamp deleteion time * @param $timestamp deleteion time
* *
@ -621,6 +626,9 @@ class Trashbin {
return $size; return $size;
} }
/**
* @param \OC\Files\View $view
*/
private static function deleteVersions($view, $file, $filename, $timestamp) { private static function deleteVersions($view, $file, $filename, $timestamp) {
$size = 0; $size = 0;
if (\OCP\App::isEnabled('files_versions')) { if (\OCP\App::isEnabled('files_versions')) {
@ -643,6 +651,9 @@ class Trashbin {
return $size; return $size;
} }
/**
* @param \OC\Files\View $view
*/
private static function deleteEncryptionKeys($view, $file, $filename, $timestamp) { private static function deleteEncryptionKeys($view, $file, $filename, $timestamp) {
$size = 0; $size = 0;
if (\OCP\App::isEnabled('files_encryption')) { if (\OCP\App::isEnabled('files_encryption')) {
@ -713,7 +724,7 @@ class Trashbin {
/** /**
* calculate remaining free space for trash bin * calculate remaining free space for trash bin
* *
* @param $trashbinSize current size of the trash bin * @param integer $trashbinSize current size of the trash bin
* @return available free space for trash bin * @return available free space for trash bin
*/ */
private static function calculateFreeSpace($trashbinSize) { private static function calculateFreeSpace($trashbinSize) {
@ -826,9 +837,9 @@ class Trashbin {
/** /**
* recursive copy to copy a whole directory * recursive copy to copy a whole directory
* *
* @param $source source path, relative to the users files directory * @param string $source source path, relative to the users files directory
* @param $destination destination path relative to the users root directoy * @param string $destination destination path relative to the users root directoy
* @param $view file view for the users root directory * @param \OC\Files\View $view file view for the users root directory
*/ */
private static function copy_recursive($source, $destination, $view) { private static function copy_recursive($source, $destination, $view) {
$size = 0; $size = 0;
@ -887,7 +898,7 @@ class Trashbin {
* find unique extension for restored file if a file with the same name already exists * find unique extension for restored file if a file with the same name already exists
* @param $location where the file should be restored * @param $location where the file should be restored
* @param $filename name of the file * @param $filename name of the file
* @param $view filesystem view relative to users root directory * @param \OC\Files\View $view filesystem view relative to users root directory
* @return string with unique extension * @return string with unique extension
*/ */
private static function getUniqueFilename($location, $filename, $view) { private static function getUniqueFilename($location, $filename, $view) {
@ -916,8 +927,8 @@ class Trashbin {
/** /**
* @brief get the size from a given root folder * @brief get the size from a given root folder
* @param $view file view on the root folder * @param \OC\Files\View $view file view on the root folder
* @return size of the folder * @return integer size of the folder
*/ */
private static function calculateSize($view) { private static function calculateSize($view) {
$root = \OCP\Config::getSystemValue('datadirectory') . $view->getAbsolutePath(''); $root = \OCP\Config::getSystemValue('datadirectory') . $view->getAbsolutePath('');

View File

@ -372,7 +372,7 @@ class Storage {
/** /**
* @brief returns all stored file versions from a given user * @brief returns all stored file versions from a given user
* @param $uid id to the user * @param string $uid id of the user
* @return array with contains two arrays 'all' which contains all versions sorted by age and 'by_file' which contains all versions sorted by filename * @return array with contains two arrays 'all' which contains all versions sorted by age and 'by_file' which contains all versions sorted by filename
*/ */
private static function getAllVersions($uid) { private static function getAllVersions($uid) {
@ -420,7 +420,7 @@ class Storage {
/** /**
* @brief get list of files we want to expire * @brief get list of files we want to expire
* @param int $currentTime timestamp of current time * @param integer $currentTime timestamp of current time
* @param array $versions list of versions * @param array $versions list of versions
* @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
*/ */

View File

@ -181,6 +181,9 @@ class Test_Files_Versioning extends \PHPUnit_Framework_TestCase {
// extend the original class to make it possible to test protected methods // extend the original class to make it possible to test protected methods
class VersionStorageToTest extends \OCA\Files_Versions\Storage { class VersionStorageToTest extends \OCA\Files_Versions\Storage {
/**
* @param integer $time
*/
public function callProtectedGetExpireList($time, $versions) { public function callProtectedGetExpireList($time, $versions) {
return self::getExpireList($time, $versions); return self::getExpireList($time, $versions);

View File

@ -107,8 +107,8 @@ class Access extends LDAPUtility {
/** /**
* @brief checks wether the given attribute`s valua is probably a DN * @brief checks wether the given attribute`s valua is probably a DN
* @param $attr the attribute in question * @param string $attr the attribute in question
* @return if so true, otherwise false * @return boolean if so true, otherwise false
*/ */
private function resemblesDN($attr) { private function resemblesDN($attr) {
$resemblingAttributes = array( $resemblingAttributes = array(
@ -175,7 +175,7 @@ class Access extends LDAPUtility {
/** /**
* @brief returns the LDAP DN for the given internal ownCloud name of the group * @brief returns the LDAP DN for the given internal ownCloud name of the group
* @param $name the ownCloud name in question * @param string $name the ownCloud name in question
* @returns string with the LDAP DN on success, otherwise false * @returns string with the LDAP DN on success, otherwise false
* *
* returns the LDAP DN for the given internal ownCloud name of the group * returns the LDAP DN for the given internal ownCloud name of the group
@ -211,7 +211,7 @@ class Access extends LDAPUtility {
/** /**
* @brief returns the LDAP DN for the given internal ownCloud name * @brief returns the LDAP DN for the given internal ownCloud name
* @param $name the ownCloud name in question * @param $name the ownCloud name in question
* @param $isUser is it a user? otherwise group * @param boolean $isUser is it a user? otherwise group
* @returns string with the LDAP DN on success, otherwise false * @returns string with the LDAP DN on success, otherwise false
* *
* returns the LDAP DN for the given internal ownCloud name * returns the LDAP DN for the given internal ownCloud name
@ -417,6 +417,9 @@ class Access extends LDAPUtility {
} }
/**
* @param boolean $isUsers
*/
private function ldap2ownCloudNames($ldapObjects, $isUsers) { private function ldap2ownCloudNames($ldapObjects, $isUsers) {
if($isUsers) { if($isUsers) {
$nameAttribute = $this->connection->ldapUserDisplayName; $nameAttribute = $this->connection->ldapUserDisplayName;
@ -509,7 +512,7 @@ class Access extends LDAPUtility {
/** /**
* @brief creates a unique name for internal ownCloud use. * @brief creates a unique name for internal ownCloud use.
* @param $name the display name of the object * @param $name the display name of the object
* @param $isUser boolean, whether name should be created for a user (true) or a group (false) * @param boolean $isUser whether name should be created for a user (true) or a group (false)
* @returns string with with the name to use in ownCloud or false if unsuccessful * @returns string with with the name to use in ownCloud or false if unsuccessful
*/ */
private function createAltInternalOwnCloudName($name, $isUser) { private function createAltInternalOwnCloudName($name, $isUser) {
@ -545,6 +548,9 @@ class Access extends LDAPUtility {
return $this->mappedComponents(true); return $this->mappedComponents(true);
} }
/**
* @param boolean $isUsers
*/
private function mappedComponents($isUsers) { private function mappedComponents($isUsers) {
$table = $this->getMapTable($isUsers); $table = $this->getMapTable($isUsers);
@ -601,14 +607,26 @@ class Access extends LDAPUtility {
return true; return true;
} }
/**
* @param integer $limit
* @param integer $offset
*/
public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null) { public function fetchListOfUsers($filter, $attr, $limit = null, $offset = null) {
return $this->fetchList($this->searchUsers($filter, $attr, $limit, $offset), (count($attr) > 1)); return $this->fetchList($this->searchUsers($filter, $attr, $limit, $offset), (count($attr) > 1));
} }
/**
* @param string $filter
* @param integer $limit
* @param integer $offset
*/
public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) { public function fetchListOfGroups($filter, $attr, $limit = null, $offset = null) {
return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1)); return $this->fetchList($this->searchGroups($filter, $attr, $limit, $offset), (count($attr) > 1));
} }
/**
* @param boolean $manyAttributes
*/
private function fetchList($list, $manyAttributes) { private function fetchList($list, $manyAttributes) {
if(is_array($list)) { if(is_array($list)) {
if($manyAttributes) { if($manyAttributes) {
@ -634,6 +652,9 @@ class Access extends LDAPUtility {
return $this->search($filter, $this->connection->ldapBaseUsers, $attr, $limit, $offset); return $this->search($filter, $this->connection->ldapBaseUsers, $attr, $limit, $offset);
} }
/**
* @param string $filter
*/
public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) { public function countUsers($filter, $attr = array('dn'), $limit = null, $offset = null) {
return $this->count($filter, $this->connection->ldapBaseGroups, $attr, $limit, $offset); return $this->count($filter, $this->connection->ldapBaseGroups, $attr, $limit, $offset);
} }
@ -702,7 +723,7 @@ class Access extends LDAPUtility {
* @param $limit maximum results to be counted * @param $limit maximum results to be counted
* @param $offset a starting point * @param $offset a starting point
* @param $pagedSearchOK whether a paged search has been executed * @param $pagedSearchOK whether a paged search has been executed
* @param $skipHandling required for paged search when cookies to * @param boolean $skipHandling required for paged search when cookies to
* prior results need to be gained * prior results need to be gained
* @returns array with the search result as first value and pagedSearchOK as * @returns array with the search result as first value and pagedSearchOK as
* second | false if not successful * second | false if not successful
@ -920,7 +941,7 @@ class Access extends LDAPUtility {
/** /**
* @brief combines the input filters with given operator * @brief combines the input filters with given operator
* @param $filters array, the filters to connect * @param $filters array, the filters to connect
* @param $operator either & or | * @param string $operator either & or |
* @returns the combined filter * @returns the combined filter
* *
* Combines Filter arguments with AND * Combines Filter arguments with AND
@ -1173,7 +1194,7 @@ class Access extends LDAPUtility {
/** /**
* @brief check wether the most recent paged search was successful. It flushed the state var. Use it always after a possible paged search. * @brief check wether the most recent paged search was successful. It flushed the state var. Use it always after a possible paged search.
* @return true on success, null or false otherwise * @return boolean|null true on success, null or false otherwise
*/ */
public function getPagedSearchResultState() { public function getPagedSearchResultState() {
$result = $this->pagedSearchedSuccessful; $result = $this->pagedSearchedSuccessful;

View File

@ -78,6 +78,9 @@ class Configuration {
'lastJpegPhotoLookup' => null, 'lastJpegPhotoLookup' => null,
); );
/**
* @param string $configPrefix
*/
public function __construct($configPrefix, $autoread = true) { public function __construct($configPrefix, $autoread = true) {
$this->configPrefix = $configPrefix; $this->configPrefix = $configPrefix;
if($autoread) { if($autoread) {
@ -106,7 +109,7 @@ class Configuration {
* @param $config array that holds the config parameters in an associated * @param $config array that holds the config parameters in an associated
* array * array
* @param &$applied optional; array where the set fields will be given to * @param &$applied optional; array where the set fields will be given to
* @return null * @return false|null
*/ */
public function setConfiguration($config, &$applied = null) { public function setConfiguration($config, &$applied = null) {
if(!is_array($config)) { if(!is_array($config)) {

View File

@ -140,6 +140,9 @@ class Connection extends LDAPUtility {
return $prefix.md5($key); return $prefix.md5($key);
} }
/**
* @param string $key
*/
public function getFromCache($key) { public function getFromCache($key) {
if(!$this->configured) { if(!$this->configured) {
$this->readConfiguration(); $this->readConfiguration();
@ -167,6 +170,9 @@ class Connection extends LDAPUtility {
return $this->cache->hasKey($key); return $this->cache->hasKey($key);
} }
/**
* @param string $key
*/
public function writeToCache($key, $value) { public function writeToCache($key, $value) {
if(!$this->configured) { if(!$this->configured) {
$this->readConfiguration(); $this->readConfiguration();
@ -201,7 +207,7 @@ class Connection extends LDAPUtility {
* @brief set LDAP configuration with values delivered by an array, not read from configuration * @brief set LDAP configuration with values delivered by an array, not read from configuration
* @param $config array that holds the config parameters in an associated array * @param $config array that holds the config parameters in an associated array
* @param &$setParameters optional; array where the set fields will be given to * @param &$setParameters optional; array where the set fields will be given to
* @return true if config validates, false otherwise. Check with $setParameters for detailed success on single parameters * @return boolean true if config validates, false otherwise. Check with $setParameters for detailed success on single parameters
*/ */
public function setConfiguration($config, &$setParameters = null) { public function setConfiguration($config, &$setParameters = null) {
if(is_null($setParameters)) { if(is_null($setParameters)) {

View File

@ -29,7 +29,7 @@ interface ILDAPWrapper {
/** /**
* @brief Bind to LDAP directory * @brief Bind to LDAP directory
* @param $link LDAP link resource * @param resource $link LDAP link resource
* @param $dn an RDN to log in with * @param $dn an RDN to log in with
* @param $password the password * @param $password the password
* @return true on success, false otherwise * @return true on success, false otherwise
@ -50,7 +50,7 @@ interface ILDAPWrapper {
* @brief Send LDAP pagination control * @brief Send LDAP pagination control
* @param $link LDAP link resource * @param $link LDAP link resource
* @param $pagesize number of results per page * @param $pagesize number of results per page
* @param $isCritical Indicates whether the pagination is critical of not. * @param boolean $isCritical Indicates whether the pagination is critical of not.
* @param $cookie structure sent by LDAP server * @param $cookie structure sent by LDAP server
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
@ -61,7 +61,7 @@ interface ILDAPWrapper {
* @param $link LDAP link resource * @param $link LDAP link resource
* @param $result LDAP result resource * @param $result LDAP result resource
* @param $cookie structure sent by LDAP server * @param $cookie structure sent by LDAP server
* @return true on success, false otherwise * @return boolean on success, false otherwise
* *
* Corresponds to ldap_control_paged_result_response * Corresponds to ldap_control_paged_result_response
*/ */
@ -124,7 +124,7 @@ interface ILDAPWrapper {
/** /**
* @brief Return next result id * @brief Return next result id
* @param $link LDAP link resource * @param $link LDAP link resource
* @param $result LDAP entry result resource * @param resource $result LDAP entry result resource
* @return an LDAP search result resource * @return an LDAP search result resource
* */ * */
public function nextEntry($link, $result); public function nextEntry($link, $result);
@ -153,7 +153,7 @@ interface ILDAPWrapper {
* @brief Sets the value of the specified option to be $value * @brief Sets the value of the specified option to be $value
* @param $link LDAP link resource * @param $link LDAP link resource
* @param $option a defined LDAP Server option * @param $option a defined LDAP Server option
* @param $value the new value for the option * @param integer $value the new value for the option
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
public function setOption($link, $option, $value); public function setOption($link, $option, $value);
@ -175,7 +175,7 @@ interface ILDAPWrapper {
/** /**
* @brief Unbind from LDAP directory * @brief Unbind from LDAP directory
* @param $link LDAP link resource * @param resource $link LDAP link resource
* @return true on success, false otherwise * @return true on success, false otherwise
*/ */
public function unbind($link); public function unbind($link);
@ -184,20 +184,20 @@ interface ILDAPWrapper {
/** /**
* @brief Checks whether the server supports LDAP * @brief Checks whether the server supports LDAP
* @return true if it the case, false otherwise * @return boolean if it the case, false otherwise
* */ * */
public function areLDAPFunctionsAvailable(); public function areLDAPFunctionsAvailable();
/** /**
* @brief Checks whether PHP supports LDAP Paged Results * @brief Checks whether PHP supports LDAP Paged Results
* @return true if it the case, false otherwise * @return boolean if it the case, false otherwise
* */ * */
public function hasPagedResultSupport(); public function hasPagedResultSupport();
/** /**
* @brief Checks whether the submitted parameter is a resource * @brief Checks whether the submitted parameter is a resource
* @param $resource the resource variable to check * @param $resource the resource variable to check
* @return true if it is a resource, false otherwise * @return boolean if it is a resource, false otherwise
*/ */
public function isResource($resource); public function isResource($resource);

View File

@ -108,7 +108,7 @@ class LDAP implements ILDAPWrapper {
/** /**
* @brief Checks whether the server supports LDAP * @brief Checks whether the server supports LDAP
* @return true if it the case, false otherwise * @return boolean if it the case, false otherwise
* */ * */
public function areLDAPFunctionsAvailable() { public function areLDAPFunctionsAvailable() {
return function_exists('ldap_connect'); return function_exists('ldap_connect');
@ -116,7 +116,7 @@ class LDAP implements ILDAPWrapper {
/** /**
* @brief Checks whether PHP supports LDAP Paged Results * @brief Checks whether PHP supports LDAP Paged Results
* @return true if it the case, false otherwise * @return boolean if it the case, false otherwise
* */ * */
public function hasPagedResultSupport() { public function hasPagedResultSupport() {
$hasSupport = function_exists('ldap_control_paged_result') $hasSupport = function_exists('ldap_control_paged_result')
@ -127,7 +127,7 @@ class LDAP implements ILDAPWrapper {
/** /**
* @brief Checks whether the submitted parameter is a resource * @brief Checks whether the submitted parameter is a resource
* @param $resource the resource variable to check * @param $resource the resource variable to check
* @return true if it is a resource, false otherwise * @return boolean if it is a resource, false otherwise
*/ */
public function isResource($resource) { public function isResource($resource) {
return is_resource($resource); return is_resource($resource);
@ -144,6 +144,9 @@ class LDAP implements ILDAPWrapper {
} }
} }
/**
* @param string $functionName
*/
private function preFunctionCall($functionName, $args) { private function preFunctionCall($functionName, $args) {
$this->curFunc = $functionName; $this->curFunc = $functionName;
$this->curArgs = $args; $this->curArgs = $args;

View File

@ -54,13 +54,16 @@ abstract class Proxy {
return 'group-'.$gid.'-lastSeenOn'; return 'group-'.$gid.'-lastSeenOn';
} }
/**
* @param boolean $passOnWhen
*/
abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen); abstract protected function callOnLastSeenOn($id, $method, $parameters, $passOnWhen);
abstract protected function walkBackends($id, $method, $parameters); abstract protected function walkBackends($id, $method, $parameters);
/** /**
* @brief Takes care of the request to the User backend * @brief Takes care of the request to the User backend
* @param $uid string, the uid connected to the request * @param $uid string, the uid connected to the request
* @param $method string, the method of the user backend that shall be called * @param string $method string, the method of the user backend that shall be called
* @param $parameters an array of parameters to be passed * @param $parameters an array of parameters to be passed
* @return mixed, the result of the specified method * @return mixed, the result of the specified method
*/ */
@ -80,6 +83,9 @@ abstract class Proxy {
return $prefix.md5($key); return $prefix.md5($key);
} }
/**
* @param string $key
*/
public function getFromCache($key) { public function getFromCache($key) {
if(!$this->isCached($key)) { if(!$this->isCached($key)) {
return null; return null;
@ -94,6 +100,9 @@ abstract class Proxy {
return $this->cache->hasKey($key); return $this->cache->hasKey($key);
} }
/**
* @param string $key
*/
public function writeToCache($key, $value) { public function writeToCache($key, $value) {
$key = $this->getCacheKey($key); $key = $this->getCacheKey($key);
$value = base64_encode(serialize($value)); $value = base64_encode(serialize($value));

View File

@ -176,7 +176,7 @@ class Wizard extends LDAPUtility {
/** /**
* @brief return the state of the mode of the specified filter * @brief return the state of the mode of the specified filter
* @param $confkey string, contains the access key of the Configuration * @param string $confkey string, contains the access key of the Configuration
*/ */
private function getFilterMode($confkey) { private function getFilterMode($confkey) {
$mode = $this->configuration->$confkey; $mode = $this->configuration->$confkey;
@ -241,6 +241,8 @@ class Wizard extends LDAPUtility {
/** /**
* @brief detects the available LDAP groups * @brief detects the available LDAP groups
* @returns the instance's WizardResult instance * @returns the instance's WizardResult instance
* @param string $dbkey
* @param string $confkey
*/ */
private function determineGroups($dbkey, $confkey, $testMemberOf = true) { private function determineGroups($dbkey, $confkey, $testMemberOf = true) {
if(!$this->checkRequirements(array('ldapHost', if(!$this->checkRequirements(array('ldapHost',
@ -554,7 +556,7 @@ class Wizard extends LDAPUtility {
/** /**
* @brief Checks whether for a given BaseDN results will be returned * @brief Checks whether for a given BaseDN results will be returned
* @param $base the BaseDN to test * @param string $base the BaseDN to test
* @return bool true on success, false otherwise * @return bool true on success, false otherwise
*/ */
private function testBaseDN($base) { private function testBaseDN($base) {
@ -615,7 +617,7 @@ class Wizard extends LDAPUtility {
/** /**
* @brief creates an LDAP Filter from given configuration * @brief creates an LDAP Filter from given configuration
* @param $filterType int, for which use case the filter shall be created * @param integer $filterType int, for which use case the filter shall be created
* can be any of self::LFILTER_USER_LIST, self::LFILTER_LOGIN or * can be any of self::LFILTER_USER_LIST, self::LFILTER_LOGIN or
* self::LFILTER_GROUP_LIST * self::LFILTER_GROUP_LIST
* @return mixed, string with the filter on success, false otherwise * @return mixed, string with the filter on success, false otherwise
@ -842,6 +844,9 @@ class Wizard extends LDAPUtility {
|| (empty($agent) && empty($pwd))); || (empty($agent) && empty($pwd)));
} }
/**
* @param string[] $reqs
*/
private function checkRequirements($reqs) { private function checkRequirements($reqs) {
$this->checkAgentRequirements(); $this->checkAgentRequirements();
foreach($reqs as $option) { foreach($reqs as $option) {
@ -860,7 +865,7 @@ class Wizard extends LDAPUtility {
* @param $attr the attribute of which a list of values shall be returned * @param $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 $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
* yields most result entries * yields most result entries
* @return mixed, an array with the values on success, false otherwise * @return mixed, an array with the values on success, false otherwise
* *
@ -922,8 +927,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 $objectclasses the objectclasses to use as search filter * @param string[] $objectclasses the objectclasses to use as search filter
* @param $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 $dbkey the dbkey of the setting the feature is connected to
* @param $confkey the confkey counterpart for the $dbkey as used in the * @param $confkey the confkey counterpart for the $dbkey as used in the
* Configuration class * Configuration class

View File

@ -139,9 +139,9 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
/** /**
* @brief Check if the password is correct * @brief Check if the password is correct
* @param $uid The username * @param string $uid The username
* @param $password The password * @param string $password The password
* @returns true/false * @return boolean
* *
* Check if the password is correct without logging in the user * Check if the password is correct without logging in the user
*/ */

View File

@ -8,6 +8,11 @@
namespace OC\Core\LostPassword; namespace OC\Core\LostPassword;
class Controller { class Controller {
/**
* @param boolean $error
* @param boolean $requested
*/
protected static function displayLostPasswordPage($error, $requested) { protected static function displayLostPasswordPage($error, $requested) {
$isEncrypted = \OC_App::isEnabled('files_encryption'); $isEncrypted = \OC_App::isEnabled('files_encryption');
\OC_Template::printGuestPage('core/lostpassword', 'lostpassword', \OC_Template::printGuestPage('core/lostpassword', 'lostpassword',
@ -16,6 +21,9 @@ class Controller {
'isEncrypted' => $isEncrypted)); 'isEncrypted' => $isEncrypted));
} }
/**
* @param boolean $success
*/
protected static function displayResetPasswordPage($success, $args) { protected static function displayResetPasswordPage($success, $args) {
$route_args = array(); $route_args = array();
$route_args['token'] = $args['token']; $route_args['token'] = $args['token'];

View File

@ -385,7 +385,7 @@ class OC {
} }
/** /**
* @return int * @return string
*/ */
private static function getSessionLifeTime() { private static function getSessionLifeTime() {
return OC_Config::getValue('session_lifetime', 60 * 60 * 24); return OC_Config::getValue('session_lifetime', 60 * 60 * 24);

View File

@ -59,7 +59,6 @@ class ActivityManager implements IManager {
* *
* $callable has to return an instance of OCA\Activity\IConsumer * $callable has to return an instance of OCA\Activity\IConsumer
* *
* @param string $key
* @param \Closure $callable * @param \Closure $callable
*/ */
function registerConsumer(\Closure $callable) { function registerConsumer(\Closure $callable) {

View File

@ -328,6 +328,9 @@ class OC_API {
} }
} }
/**
* @param XMLWriter $writer
*/
private static function toXML($array, $writer) { private static function toXML($array, $writer) {
foreach($array as $k => $v) { foreach($array as $k => $v) {
if ($k[0] === '@') { if ($k[0] === '@') {

View File

@ -38,7 +38,7 @@ class OC_App{
/** /**
* @brief clean the appid * @brief clean the appid
* @param $app Appid that needs to be cleaned * @param string|boolean $app Appid that needs to be cleaned
* @return string * @return string
*/ */
public static function cleanAppId($app) { public static function cleanAppId($app) {
@ -261,7 +261,7 @@ class OC_App{
/** /**
* @brief disables an app * @brief disables an app
* @param string $app app * @param string $app app
* @return bool * @return boolean|null
* *
* This function set an app as disabled in appconfig. * This function set an app as disabled in appconfig.
*/ */
@ -342,7 +342,7 @@ class OC_App{
/** /**
* @brief Returns the Settings Navigation * @brief Returns the Settings Navigation
* @return array * @return string
* *
* This function returns an array containing all settings pages added. The * This function returns an array containing all settings pages added. The
* entries are sorted by the key 'order' ascending. * entries are sorted by the key 'order' ascending.
@ -437,6 +437,7 @@ class OC_App{
/** /**
* Get the path where to install apps * Get the path where to install apps
* @return string
*/ */
public static function getInstallPath() { public static function getInstallPath() {
if(OC_Config::getValue('appstoreenabled', true)==false) { if(OC_Config::getValue('appstoreenabled', true)==false) {
@ -490,6 +491,7 @@ class OC_App{
/** /**
* get the last version of the app, either from appinfo/version or from appinfo/info.xml * get the last version of the app, either from appinfo/version or from appinfo/info.xml
* @return string
*/ */
public static function getAppVersion($appid) { public static function getAppVersion($appid) {
$file= self::getAppPath($appid).'/appinfo/version'; $file= self::getAppPath($appid).'/appinfo/version';
@ -570,7 +572,7 @@ class OC_App{
/** /**
* @brief Returns the navigation * @brief Returns the navigation
* @return array * @return string
* *
* This function returns an array containing all entries added. The * This function returns an array containing all entries added. The
* entries are sorted by the key 'order' ascending. Additional to the keys * entries are sorted by the key 'order' ascending. Additional to the keys
@ -854,6 +856,7 @@ class OC_App{
/** /**
* check if the app needs updating and update when needed * check if the app needs updating and update when needed
* @param string $app
*/ */
public static function checkUpgrade($app) { public static function checkUpgrade($app) {
if (in_array($app, self::$checkedApps)) { if (in_array($app, self::$checkedApps)) {

View File

@ -84,6 +84,9 @@ class OC_Appconfig {
return $keys; return $keys;
} }
/**
* @param string $app
*/
private static function getAppValues($app) { private static function getAppValues($app) {
if (!isset(self::$cache[$app])) { if (!isset(self::$cache[$app])) {
self::$cache[$app] = array(); self::$cache[$app] = array();
@ -145,7 +148,7 @@ class OC_Appconfig {
* @param string $app app * @param string $app app
* @param string $key key * @param string $key key
* @param string $value value * @param string $value value
* @return bool * @return boolean|null
* *
* 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.
*/ */
@ -212,6 +215,8 @@ class OC_Appconfig {
* *
* @param app * @param app
* @param key * @param key
* @param boolean $app
* @param string $key
* @return array * @return array
*/ */
public static function getValues($app, $key) { public static function getValues($app, $key) {

View File

@ -135,7 +135,7 @@ class DIContainer extends SimpleContainer implements IAppContainer{
/** /**
* @param Middleware $middleWare * @param Middleware $middleWare
* @return boolean * @return boolean|null
*/ */
function registerMiddleWare(Middleware $middleWare) { function registerMiddleWare(Middleware $middleWare) {
array_push($this->middleWares, $middleWare); array_push($this->middleWares, $middleWare);

View File

@ -108,7 +108,7 @@ class Http extends BaseHttp {
* Gets the correct header * Gets the correct header
* @param Http::CONSTANT $status the constant from the Http class * @param Http::CONSTANT $status the constant from the Http class
* @param \DateTime $lastModified formatted last modified date * @param \DateTime $lastModified formatted last modified date
* @param string $Etag the etag * @param string $ETag the etag
*/ */
public function getStatusHeader($status, \DateTime $lastModified=null, public function getStatusHeader($status, \DateTime $lastModified=null,
$ETag=null) { $ETag=null) {

View File

@ -25,7 +25,7 @@
namespace OC\AppFramework\Http; namespace OC\AppFramework\Http;
use OCP\AppFramework\Http\Response, use OCP\AppFramework\Http\Response,
OCP\AppFramework\Http; OCP\AppFramework\Http;
/** /**

View File

@ -114,7 +114,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
* $request['myvar'] = 'something'; // This throws an exception. * $request['myvar'] = 'something'; // This throws an exception.
* *
* @param string $offset The key to lookup * @param string $offset The key to lookup
* @return string|null * @return boolean
*/ */
public function offsetExists($offset) { public function offsetExists($offset) {
return isset($this->items['parameters'][$offset]); return isset($this->items['parameters'][$offset]);

View File

@ -56,7 +56,7 @@ class MiddlewareDispatcher {
/** /**
* Adds a new middleware * Adds a new middleware
* @param Middleware $middleware the middleware which will be added * @param Middleware $middleWare the middleware which will be added
*/ */
public function registerMiddleware(Middleware $middleWare){ public function registerMiddleware(Middleware $middleWare){
array_push($this->middlewares, $middleWare); array_push($this->middlewares, $middleWare);

View File

@ -32,7 +32,6 @@ class SecurityException extends \Exception {
/** /**
* @param string $msg the security error message * @param string $msg the security error message
* @param bool $ajax true if it resulted because of an ajax request
*/ */
public function __construct($msg, $code = 0) { public function __construct($msg, $code = 0) {
parent::__construct($msg, $code); parent::__construct($msg, $code);

View File

@ -30,6 +30,10 @@ class RouteActionHandler {
private $actionName; private $actionName;
private $container; private $container;
/**
* @param string $controllerName
* @param string $actionName
*/
public function __construct(DIContainer $container, $controllerName, $actionName) { public function __construct(DIContainer $container, $controllerName, $actionName) {
$this->controllerName = $controllerName; $this->controllerName = $controllerName;
$this->actionName = $actionName; $this->actionName = $actionName;

View File

@ -37,7 +37,6 @@ class RouteConfig {
/** /**
* @param \OC\AppFramework\DependencyInjection\DIContainer $container * @param \OC\AppFramework\DependencyInjection\DIContainer $container
* @param \OC_Router $router * @param \OC_Router $router
* @param string $pathToYml
* @internal param $appName * @internal param $appName
*/ */
public function __construct(DIContainer $container, \OC_Router $router, $routes) { public function __construct(DIContainer $container, \OC_Router $router, $routes) {

View File

@ -31,7 +31,7 @@ class SimpleContainer extends \Pimple implements \OCP\IContainer {
* Created instance will be cached in case $shared is true. * Created instance will be cached in case $shared is true.
* *
* @param string $name name of the service to register another backend for * @param string $name name of the service to register another backend for
* @param callable $closure the closure to be called on service creation * @param \Closure $closure the closure to be called on service creation
*/ */
function registerService($name, \Closure $closure, $shared = true) function registerService($name, \Closure $closure, $shared = true)
{ {

View File

@ -10,6 +10,7 @@ abstract class OC_Archive{
/** /**
* open any of the supported archive types * open any of the supported archive types
* @param string path * @param string path
* @param string $path
* @return OC_Archive * @return OC_Archive
*/ */
public static function open($path) { public static function open($path) {
@ -33,6 +34,7 @@ abstract class OC_Archive{
/** /**
* add an empty folder to the archive * add an empty folder to the archive
* @param string path * @param string path
* @param string $path
* @return bool * @return bool
*/ */
abstract function addFolder($path); abstract function addFolder($path);
@ -40,6 +42,7 @@ abstract class OC_Archive{
* add a file to the archive * add a file to the archive
* @param string path * @param string path
* @param string source either a local file or string data * @param string source either a local file or string data
* @param string $path
* @return bool * @return bool
*/ */
abstract function addFile($path, $source=''); abstract function addFile($path, $source='');
@ -116,7 +119,7 @@ abstract class OC_Archive{
* add a folder and all its content * add a folder and all its content
* @param string $path * @param string $path
* @param string source * @param string source
* @return bool * @return boolean|null
*/ */
function addRecursive($path, $source) { function addRecursive($path, $source) {
$dh = opendir($source); $dh = opendir($source);

View File

@ -31,7 +31,7 @@ class OC_Archive_TAR extends OC_Archive{
/** /**
* try to detect the type of tar compression * try to detect the type of tar compression
* @param string file * @param string file
* @return str * @return integer
*/ */
static public function getTarType($file) { static public function getTarType($file) {
if(strpos($file, '.')) { if(strpos($file, '.')) {
@ -211,6 +211,7 @@ class OC_Archive_TAR extends OC_Archive{
* extract a single file from the archive * extract a single file from the archive
* @param string path * @param string path
* @param string dest * @param string dest
* @param string $dest
* @return bool * @return bool
*/ */
function extractFile($path, $dest) { function extractFile($path, $dest) {
@ -233,6 +234,7 @@ class OC_Archive_TAR extends OC_Archive{
* extract the archive * extract the archive
* @param string path * @param string path
* @param string dest * @param string dest
* @param string $dest
* @return bool * @return bool
*/ */
function extract($dest) { function extract($dest) {

View File

@ -51,7 +51,7 @@ class OC_Archive_ZIP extends OC_Archive{
* rename a file or folder in the archive * rename a file or folder in the archive
* @param string source * @param string source
* @param string dest * @param string dest
* @return bool * @return boolean|null
*/ */
function rename($source, $dest) { function rename($source, $dest) {
$source=$this->stripPath($source); $source=$this->stripPath($source);
@ -117,7 +117,8 @@ class OC_Archive_ZIP extends OC_Archive{
* extract a single file from the archive * extract a single file from the archive
* @param string path * @param string path
* @param string dest * @param string dest
* @return bool * @param string $dest
* @return boolean|null
*/ */
function extractFile($path, $dest) { function extractFile($path, $dest) {
$fp = $this->zip->getStream($path); $fp = $this->zip->getStream($path);
@ -127,6 +128,7 @@ class OC_Archive_ZIP extends OC_Archive{
* extract the archive * extract the archive
* @param string path * @param string path
* @param string dest * @param string dest
* @param string $dest
* @return bool * @return bool
*/ */
function extract($dest) { function extract($dest) {
@ -191,6 +193,9 @@ class OC_Archive_ZIP extends OC_Archive{
} }
} }
/**
* @return string
*/
private function stripPath($path) { private function stripPath($path) {
if(!$path || $path[0]=='/') { if(!$path || $path[0]=='/') {
return substr($path, 1); return substr($path, 1);

View File

@ -30,6 +30,9 @@ class ArrayParser {
const TYPE_STRING = 3; const TYPE_STRING = 3;
const TYPE_ARRAY = 4; const TYPE_ARRAY = 4;
/**
* @param string $string
*/
function parsePHP($string) { function parsePHP($string) {
$string = $this->stripPHPTags($string); $string = $this->stripPHPTags($string);
$string = $this->stripAssignAndReturn($string); $string = $this->stripAssignAndReturn($string);
@ -47,6 +50,9 @@ class ArrayParser {
return $string; return $string;
} }
/**
* @param string $string
*/
function stripAssignAndReturn($string) { function stripAssignAndReturn($string) {
$string = trim($string); $string = trim($string);
if (substr($string, 0, 6) === 'return') { if (substr($string, 0, 6) === 'return') {
@ -74,6 +80,9 @@ class ArrayParser {
return null; return null;
} }
/**
* @param string $string
*/
function getType($string) { function getType($string) {
$string = strtolower($string); $string = strtolower($string);
$first = substr($string, 0, 1); $first = substr($string, 0, 1);
@ -90,19 +99,31 @@ class ArrayParser {
} }
} }
/**
* @param string $string
*/
function parseString($string) { function parseString($string) {
return substr($string, 1, -1); return substr($string, 1, -1);
} }
/**
* @param string $string
*/
function parseNum($string) { function parseNum($string) {
return intval($string); return intval($string);
} }
/**
* @param string $string
*/
function parseBool($string) { function parseBool($string) {
$string = strtolower($string); $string = strtolower($string);
return $string === 'true'; return $string === 'true';
} }
/**
* @param string $string
*/
function parseArray($string) { function parseArray($string) {
$body = substr($string, 5); $body = substr($string, 5);
$body = trim($body); $body = trim($body);
@ -131,6 +152,9 @@ class ArrayParser {
return $result; return $result;
} }
/**
* @param string $body
*/
function splitArray($body) { function splitArray($body) {
$inSingleQuote = false;//keep track if we are inside quotes $inSingleQuote = false;//keep track if we are inside quotes
$inDoubleQuote = false; $inDoubleQuote = false;

View File

@ -37,8 +37,8 @@ class OC_BackgroundJob{
/** /**
* @brief sets the background jobs execution type * @brief sets the background jobs execution type
* @param $type execution type * @param string $type execution type
* @return boolean * @return boolean|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

@ -34,7 +34,7 @@ class JobList {
} }
/** /**
* @param Job|string $job * @param Job $job
* @param mixed $argument * @param mixed $argument
*/ */
public function remove($job, $argument = null) { public function remove($job, $argument = null) {
@ -154,7 +154,7 @@ class JobList {
/** /**
* get the id of the last ran job * get the id of the last ran job
* *
* @return int * @return string
*/ */
public function getLastJob() { public function getLastJob() {
return \OC_Appconfig::getValue('backgroundjob', 'lastjob', 0); return \OC_Appconfig::getValue('backgroundjob', 'lastjob', 0);

View File

@ -29,6 +29,9 @@ class File {
} }
} }
/**
* @param string $key
*/
public function get($key) { public function get($key) {
$result = null; $result = null;
$proxyStatus = \OC_FileProxy::$enabled; $proxyStatus = \OC_FileProxy::$enabled;
@ -59,6 +62,9 @@ class File {
return $result; return $result;
} }
/**
* @param string $key
*/
public function set($key, $value, $ttl=0) { public function set($key, $value, $ttl=0) {
$storage = $this->getStorage(); $storage = $this->getStorage();
$result = false; $result = false;
@ -87,6 +93,9 @@ class File {
return false; return false;
} }
/**
* @param string $key
*/
public function remove($key) { public function remove($key) {
$storage = $this->getStorage(); $storage = $this->getStorage();
if(!$storage) { if(!$storage) {

View File

@ -21,6 +21,9 @@ class FileGlobal {
return str_replace('/', '_', $key); return str_replace('/', '_', $key);
} }
/**
* @param string $key
*/
public function get($key) { public function get($key) {
$key = $this->fixKey($key); $key = $this->fixKey($key);
if ($this->hasKey($key)) { if ($this->hasKey($key)) {
@ -30,6 +33,10 @@ class FileGlobal {
return null; return null;
} }
/**
* @param string $key
* @param string $value
*/
public function set($key, $value, $ttl=0) { public function set($key, $value, $ttl=0) {
$key = $this->fixKey($key); $key = $this->fixKey($key);
$cache_dir = self::getCacheDir(); $cache_dir = self::getCacheDir();

View File

@ -206,6 +206,9 @@ class OC_Connector_Sabre_File extends OC_Connector_Sabre_Node implements Sabre_D
} }
/**
* @param resource $data
*/
private function createFileChunked($data) private function createFileChunked($data)
{ {
list($path, $name) = \Sabre_DAV_URLUtil::splitPath($this->path); list($path, $name) = \Sabre_DAV_URLUtil::splitPath($this->path);

View File

@ -153,9 +153,8 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
/** /**
* @brief Updates properties on this node, * @brief Updates properties on this node,
* @param array $mutations
* @see Sabre_DAV_IProperties::updateProperties * @see Sabre_DAV_IProperties::updateProperties
* @return bool|array * @return boolean
*/ */
public function updateProperties($properties) { public function updateProperties($properties) {
$existing = $this->getProperties(array()); $existing = $this->getProperties(array());
@ -267,7 +266,7 @@ abstract class OC_Connector_Sabre_Node implements Sabre_DAV_INode, Sabre_DAV_IPr
} }
/** /**
* @return mixed * @return string|null
*/ */
public function getFileId() public function getFileId()
{ {

View File

@ -62,7 +62,7 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend {
* Returns the list of members for a group-principal * Returns the list of members for a group-principal
* *
* @param string $principal * @param string $principal
* @return array * @return string[]
*/ */
public function getGroupMemberSet($principal) { public function getGroupMemberSet($principal) {
// TODO: for now the group principal has only one member, the user itself // TODO: for now the group principal has only one member, the user itself

View File

@ -45,7 +45,6 @@ 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
* *
* @param string $method
* @throws Sabre_DAV_Exception * @throws Sabre_DAV_Exception
* @return bool * @return bool
*/ */

View File

@ -67,6 +67,7 @@ class OC_Connector_Sabre_Server extends Sabre_DAV_Server {
/** /**
* Small helper to support PROPFIND with DEPTH_INFINITY. * Small helper to support PROPFIND with DEPTH_INFINITY.
* @param string $path
*/ */
private function addPathNodesRecursively(&$nodes, $path) { private function addPathNodesRecursively(&$nodes, $path) {
foreach($this->tree->getChildren($path) as $childNode) { foreach($this->tree->getChildren($path) as $childNode) {

View File

@ -32,6 +32,7 @@ class OC_DAVClient extends \Sabre_DAV_Client {
/** /**
* @brief Sets the request timeout or 0 to disable timeout. * @brief Sets the request timeout or 0 to disable timeout.
* @param int timeout in seconds or 0 to disable * @param int timeout in seconds or 0 to disable
* @param integer $timeout
*/ */
public function setRequestTimeout($timeout) { public function setRequestTimeout($timeout) {
$this->requestTimeout = (int)$timeout; $this->requestTimeout = (int)$timeout;

View File

@ -51,7 +51,7 @@ class OC_DB {
/** /**
* @brief connects to the database * @brief connects to the database
* @return bool true if connection can be established or false on error * @return boolean|null true if connection can be established or false on error
* *
* Connects to the database as specified in config.php * Connects to the database as specified in config.php
*/ */
@ -196,7 +196,7 @@ class OC_DB {
* @param int $offset * @param int $offset
* @param bool $isManipulation * @param bool $isManipulation
* @throws DatabaseException * @throws DatabaseException
* @return \Doctrine\DBAL\Statement prepared SQL query * @return OC_DB_StatementWrapper prepared SQL query
* *
* SQL query via Doctrine prepare(), needs to be execute()'d! * SQL query via Doctrine prepare(), needs to be execute()'d!
*/ */
@ -298,7 +298,7 @@ class OC_DB {
/** /**
* @brief gets last value of autoincrement * @brief gets last value of autoincrement
* @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix * @param string $table The optional table name (will replace *PREFIX*) and add sequence suffix
* @return int id * @return string id
* @throws DatabaseException * @throws DatabaseException
* *
* \Doctrine\DBAL\Connection lastInsertId * \Doctrine\DBAL\Connection lastInsertId
@ -315,7 +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
* @return int number of updated rows * @return boolean number of updated rows
*/ */
public static function insertIfNotExist($table, $input) { public static function insertIfNotExist($table, $input) {
self::connect(); self::connect();
@ -368,7 +368,7 @@ class OC_DB {
* @brief update the database schema * @brief update the database schema
* @param string $file file to read structure from * @param string $file file to read structure from
* @throws Exception * @throws Exception
* @return bool * @return string|boolean
*/ */
public static function updateDbFromStructure($file) { public static function updateDbFromStructure($file) {
$schemaManager = self::getMDB2SchemaManager(); $schemaManager = self::getMDB2SchemaManager();

View File

@ -94,7 +94,7 @@ class Connection extends \Doctrine\DBAL\Connection {
* If an SQLLogger is configured, the execution is logged. * If an SQLLogger is configured, the execution is logged.
* *
* @param string $query The SQL query to execute. * @param string $query The SQL query to execute.
* @param array $params The parameters to bind to the query, if any. * @param string[] $params The parameters to bind to the query, if any.
* @param array $types The types the previous parameters are in. * @param array $types The types the previous parameters are in.
* @param QueryCacheProfile $qcp * @param QueryCacheProfile $qcp
* @return \Doctrine\DBAL\Driver\Statement The executed statement. * @return \Doctrine\DBAL\Driver\Statement The executed statement.

View File

@ -31,8 +31,8 @@ class ConnectionWrapper implements \OCP\IDBConnection {
/** /**
* Used to get the id of the just inserted element * Used to get the id of the just inserted element
* @param string $tableName the name of the table where we inserted the item * @param string $table the name of the table where we inserted the item
* @return int the id of the inserted element * @return string the id of the inserted element
*/ */
public function lastInsertId($table = null) public function lastInsertId($table = null)
{ {

View File

@ -53,7 +53,7 @@ class MDB2SchemaManager {
/** /**
* @brief update the database scheme * @brief update the database scheme
* @param string $file file to read structure from * @param string $file file to read structure from
* @return bool * @return string|boolean
*/ */
public function updateDbFromStructure($file, $generateSql = false) { public function updateDbFromStructure($file, $generateSql = false) {
$sm = $this->conn->getSchemaManager(); $sm = $this->conn->getSchemaManager();

View File

@ -9,7 +9,7 @@
class OC_DB_MDB2SchemaWriter { class OC_DB_MDB2SchemaWriter {
/** /**
* @param $file * @param string $file
* @param \Doctrine\DBAL\Schema\AbstractSchemaManager $sm * @param \Doctrine\DBAL\Schema\AbstractSchemaManager $sm
* @return bool * @return bool
*/ */
@ -26,6 +26,9 @@ class OC_DB_MDB2SchemaWriter {
return true; return true;
} }
/**
* @param SimpleXMLElement $xml
*/
private static function saveTable($table, $xml) { private static function saveTable($table, $xml) {
$xml->addChild('name', $table->getName()); $xml->addChild('name', $table->getName());
$declaration = $xml->addChild('declaration'); $declaration = $xml->addChild('declaration');

View File

@ -17,6 +17,9 @@ class OC_DB_StatementWrapper {
private $isManipulation = false; private $isManipulation = false;
private $lastArguments = array(); private $lastArguments = array();
/**
* @param boolean $isManipulation
*/
public function __construct($statement, $isManipulation) { public function __construct($statement, $isManipulation) {
$this->statement = $statement; $this->statement = $statement;
$this->isManipulation = $isManipulation; $this->isManipulation = $isManipulation;

View File

@ -39,6 +39,9 @@ class OC_Defaults {
} }
} }
/**
* @param string $method
*/
private function themeExist($method) { private function themeExist($method) {
if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) { if (OC_Util::getTheme() !== '' && method_exists('OC_Theme', $method)) {
return true; return true;

View File

@ -16,6 +16,9 @@ class OC_FileChunking {
return $matches; return $matches;
} }
/**
* @param string[] $info
*/
public function __construct($info) { public function __construct($info) {
$this->info = $info; $this->info = $info;
} }
@ -37,7 +40,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 $index * @param string $index
* @param $data * @param $data
* @return int * @return int
*/ */
@ -87,7 +90,7 @@ class OC_FileChunking {
/** /**
* Removes one specific chunk * Removes one specific chunk
* @param $index * @param string $index
*/ */
public function remove($index) { public function remove($index) {
$cache = $this->getCache(); $cache = $this->getCache();
@ -124,6 +127,9 @@ class OC_FileChunking {
); );
} }
/**
* @param string $path
*/
public function file_assemble($path) { public function file_assemble($path) {
$absolutePath = \OC\Files\Filesystem::normalizePath(\OC\Files\Filesystem::getView()->getAbsolutePath($path)); $absolutePath = \OC\Files\Filesystem::normalizePath(\OC\Files\Filesystem::getView()->getAbsolutePath($path));
$data = ''; $data = '';

View File

@ -67,6 +67,9 @@ class OC_FileProxy{
self::$proxies[]=$proxy; self::$proxies[]=$proxy;
} }
/**
* @param string $operation
*/
public static function getProxies($operation = null) { public static function getProxies($operation = null) {
if ($operation === null) { if ($operation === null) {
// return all // return all
@ -81,6 +84,10 @@ class OC_FileProxy{
return $proxies; return $proxies;
} }
/**
* @param string $operation
* @param string|boolean $filepath
*/
public static function runPreProxies($operation,&$filepath,&$filepath2=null) { public static function runPreProxies($operation,&$filepath,&$filepath2=null) {
if(!self::$enabled) { if(!self::$enabled) {
return true; return true;
@ -101,6 +108,11 @@ class OC_FileProxy{
return true; return true;
} }
/**
* @param string $operation
*
* @return string
*/
public static function runPostProxies($operation, $path, $result) { public static function runPostProxies($operation, $path, $result) {
if(!self::$enabled) { if(!self::$enabled) {
return $result; return $result;

View File

@ -40,7 +40,7 @@ class OC_Files {
* return the content of a file or return a zip file containing multiple files * return the content of a file or return a zip file containing multiple files
* *
* @param string $dir * @param string $dir
* @param string $file ; separated list of files to download * @param string $files ; separated list of files to download
* @param boolean $only_header ; boolean to only send header of the request * @param boolean $only_header ; boolean to only send header of the request
*/ */
public static function get($dir, $files, $only_header = false) { public static function get($dir, $files, $only_header = false) {
@ -170,6 +170,9 @@ class OC_Files {
} }
} }
/**
* @param false|string $filename
*/
private static function addSendfileHeader($filename) { private static function addSendfileHeader($filename) {
if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) { if (isset($_SERVER['MOD_X_SENDFILE_ENABLED'])) {
header("X-Sendfile: " . $filename); header("X-Sendfile: " . $filename);
@ -194,6 +197,10 @@ class OC_Files {
} }
} }
/**
* @param string $dir
* @param ZipArchive $zip
*/
public static function zipAddDir($dir, $zip, $internalDir='') { public static function zipAddDir($dir, $zip, $internalDir='') {
$dirname=basename($dir); $dirname=basename($dir);
$zip->addEmptyDir($internalDir.$dirname); $zip->addEmptyDir($internalDir.$dirname);
@ -215,7 +222,7 @@ class OC_Files {
/** /**
* checks if the selected files are within the size constraint. If not, outputs an error page. * checks if the selected files are within the size constraint. If not, outputs an error page.
* *
* @param dir $dir * @param string $dir
* @param files $files * @param files $files
*/ */
static function validateZipDownload($dir, $files) { static function validateZipDownload($dir, $files) {

View File

@ -24,6 +24,9 @@ class BackgroundWatcher {
return $row['id']; return $row['id'];
} }
/**
* @param integer $id
*/
static private function checkUpdate($id) { static private function checkUpdate($id) {
$cacheItem = Cache::getById($id); $cacheItem = Cache::getById($id);
if (is_null($cacheItem)) { if (is_null($cacheItem)) {

View File

@ -487,7 +487,7 @@ class Cache {
/** /**
* update the folder size and the size of all parent folders * update the folder size and the size of all parent folders
* *
* @param $path * @param string|boolean $path
*/ */
public function correctFolderSize($path) { public function correctFolderSize($path) {
$this->calculateFolderSize($path); $this->calculateFolderSize($path);

View File

@ -38,6 +38,9 @@ class HomeCache extends Cache {
return $totalSize; return $totalSize;
} }
/**
* @param string $path
*/
public function get($path) { public function get($path) {
$data = parent::get($path); $data = parent::get($path);
if ($path === '' or $path === '/') { if ($path === '' or $path === '/') {

View File

@ -16,6 +16,9 @@ class Legacy {
private $cacheHasItems = null; private $cacheHasItems = null;
/**
* @param string $user
*/
public function __construct($user) { public function __construct($user) {
$this->user = $user; $this->user = $user;
} }
@ -69,7 +72,7 @@ class Legacy {
/** /**
* get an item from the legacy cache * get an item from the legacy cache
* *
* @param string|int $path * @param string $path
* @return array * @return array
*/ */
function get($path) { function get($path) {

View File

@ -47,6 +47,9 @@ class Storage {
return $this->numericId; return $this->numericId;
} }
/**
* @return string
*/
public static function getStorageId($numericId) { public static function getStorageId($numericId) {
$sql = 'SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?'; $sql = 'SELECT `id` FROM `*PREFIX*storages` WHERE `numeric_id` = ?';
@ -58,6 +61,9 @@ class Storage {
} }
} }
/**
* @param string $storageId
*/
public static function exists($storageId) { public static function exists($storageId) {
if (strlen($storageId) > 64) { if (strlen($storageId) > 64) {
$storageId = md5($storageId); $storageId = md5($storageId);

View File

@ -112,7 +112,7 @@ class Updater {
/** /**
* @brief get file owner and path * @brief get file owner and path
* @param string $filename * @param string $filename
* @return array with the oweners uid and the owners path * @return string[] with the oweners uid and the owners path
*/ */
private static function getUidAndFilename($filename) { private static function getUidAndFilename($filename) {

View File

@ -614,6 +614,9 @@ class Filesystem {
return self::$defaultInstance->touch($path, $mtime); return self::$defaultInstance->touch($path, $mtime);
} }
/**
* @return string
*/
static public function file_get_contents($path) { static public function file_get_contents($path) {
return self::$defaultInstance->file_get_contents($path); return self::$defaultInstance->file_get_contents($path);
} }
@ -638,6 +641,9 @@ class Filesystem {
return self::$defaultInstance->fopen($path, $mode); return self::$defaultInstance->fopen($path, $mode);
} }
/**
* @return string
*/
static public function toTmpFile($path) { static public function toTmpFile($path) {
return self::$defaultInstance->toTmpFile($path); return self::$defaultInstance->toTmpFile($path);
} }

View File

@ -44,7 +44,7 @@ class Mapper
/** /**
* @param string $path * @param string $path
* @param bool $isLogicPath indicates if $path is logical or physical * @param bool $isLogicPath indicates if $path is logical or physical
* @param $recursive * @param boolean $recursive
* @return void * @return void
*/ */
public function removePath($path, $isLogicPath, $recursive) { public function removePath($path, $isLogicPath, $recursive) {
@ -60,8 +60,8 @@ class Mapper
} }
/** /**
* @param $path1 * @param string $path1
* @param $path2 * @param string $path2
* @throws \Exception * @throws \Exception
*/ */
public function copy($path1, $path2) public function copy($path1, $path2)
@ -99,7 +99,7 @@ class Mapper
/** /**
* @param $path * @param $path
* @param $root * @param $root
* @return bool|string * @return false|string
*/ */
public function stripRootFolder($path, $root) { public function stripRootFolder($path, $root) {
if (strpos($path, $root) !== 0) { if (strpos($path, $root) !== 0) {
@ -120,6 +120,9 @@ class Mapper
return $path; return $path;
} }
/**
* @param string $logicPath
*/
private function resolveLogicPath($logicPath) { private function resolveLogicPath($logicPath) {
$logicPath = $this->stripLast($logicPath); $logicPath = $this->stripLast($logicPath);
$sql = 'SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?'; $sql = 'SELECT * FROM `*PREFIX*file_map` WHERE `logic_path_hash` = ?';
@ -141,6 +144,10 @@ class Mapper
return $result['logic_path']; return $result['logic_path'];
} }
/**
* @param string $logicPath
* @param boolean $store
*/
private function create($logicPath, $store) { private function create($logicPath, $store) {
$logicPath = $this->stripLast($logicPath); $logicPath = $this->stripLast($logicPath);
$index = 0; $index = 0;
@ -167,6 +174,9 @@ class Mapper
\OC_DB::executeAudited($sql, array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath))); \OC_DB::executeAudited($sql, array($logicPath, $physicalPath, md5($logicPath), md5($physicalPath)));
} }
/**
* @param integer $index
*/
public function slugifyPath($path, $index=null) { public function slugifyPath($path, $index=null) {
$path = $this->stripRootFolder($path, $this->unchangedPhysicalRoot); $path = $this->stripRootFolder($path, $this->unchangedPhysicalRoot);

View File

@ -106,7 +106,7 @@ class Manager {
* Find mounts by numeric storage id * Find mounts by numeric storage id
* *
* @param string $id * @param string $id
* @return Mount * @return Mount[]
*/ */
public function findByNumericId($id) { public function findByNumericId($id) {
$storageId = \OC\Files\Cache\Storage::getStorageId($id); $storageId = \OC\Files\Cache\Storage::getStorageId($id);

View File

@ -33,6 +33,7 @@ class Node implements \OCP\Files\Node {
* @param \OC\Files\View $view * @param \OC\Files\View $view
* @param \OC\Files\Node\Root Root $root * @param \OC\Files\Node\Root Root $root
* @param string $path * @param string $path
* @param Root $root
*/ */
public function __construct($root, $view, $path) { public function __construct($root, $view, $path) {
$this->view = $view; $this->view = $view;

View File

@ -95,7 +95,7 @@ class Root extends Folder implements Emitter {
/** /**
* @param string $scope * @param string $scope
* @param string $method * @param string $method
* @param array $arguments * @param Node[] $arguments
*/ */
public function emit($scope, $method, $arguments = array()) { public function emit($scope, $method, $arguments = array()) {
$this->emitter->emit($scope, $method, $arguments); $this->emitter->emit($scope, $method, $arguments);
@ -154,7 +154,7 @@ class Root extends Folder implements Emitter {
* @param string $path * @param string $path
* @throws \OCP\Files\NotFoundException * @throws \OCP\Files\NotFoundException
* @throws \OCP\Files\NotPermittedException * @throws \OCP\Files\NotPermittedException
* @return Node * @return string
*/ */
public function get($path) { public function get($path) {
$path = $this->normalizePath($path); $path = $this->normalizePath($path);

View File

@ -202,6 +202,9 @@ abstract class Common implements \OC\Files\Storage\Storage {
return $this->toTmpFile($path); return $this->toTmpFile($path);
} }
/**
* @param string $path
*/
private function toTmpFile($path) { //no longer in the storage api, still useful here private function toTmpFile($path) { //no longer in the storage api, still useful here
$source = $this->fopen($path, 'r'); $source = $this->fopen($path, 'r');
if (!$source) { if (!$source) {
@ -224,6 +227,10 @@ abstract class Common implements \OC\Files\Storage\Storage {
return $baseDir; return $baseDir;
} }
/**
* @param string $path
* @param string $target
*/
private function addLocalFolder($path, $target) { private function addLocalFolder($path, $target) {
$dh = $this->opendir($path); $dh = $this->opendir($path);
if (is_resource($dh)) { if (is_resource($dh)) {
@ -241,6 +248,9 @@ abstract class Common implements \OC\Files\Storage\Storage {
} }
} }
/**
* @param string $query
*/
protected function searchInDir($query, $dir = '') { protected function searchInDir($query, $dir = '') {
$files = array(); $files = array();
$dh = $this->opendir($dir); $dh = $this->opendir($dir);

View File

@ -25,6 +25,10 @@ class Loader {
$this->storageWrappers[] = $callback; $this->storageWrappers[] = $callback;
} }
/**
* @param string|boolean $mountPoint
* @param string $class
*/
public function load($mountPoint, $class, $arguments) { public function load($mountPoint, $class, $arguments) {
return $this->wrap($mountPoint, new $class($arguments)); return $this->wrap($mountPoint, new $class($arguments));
} }

View File

@ -203,6 +203,9 @@ if (\OC_Util::runningOnWindows()) {
return $return; return $return;
} }
/**
* @param string $dir
*/
private function delTree($dir) { private function delTree($dir) {
$dirRelative = $dir; $dirRelative = $dir;
$dir = $this->datadir . $dir; $dir = $this->datadir . $dir;
@ -224,6 +227,9 @@ if (\OC_Util::runningOnWindows()) {
return $return; return $return;
} }
/**
* @param string $fullPath
*/
private static function getFileSizeFromOS($fullPath) { private static function getFileSizeFromOS($fullPath) {
$name = strtolower(php_uname('s')); $name = strtolower(php_uname('s'));
// Windows OS: we use COM to access the filesystem // Windows OS: we use COM to access the filesystem
@ -274,6 +280,9 @@ if (\OC_Util::runningOnWindows()) {
return $this->datadir . $path; return $this->datadir . $path;
} }
/**
* @param string $query
*/
protected function searchInDir($query, $dir = '') { protected function searchInDir($query, $dir = '') {
$files = array(); $files = array();
foreach (scandir($this->datadir . $dir) as $item) { foreach (scandir($this->datadir . $dir) as $item) {

View File

@ -210,6 +210,9 @@ class MappedLocal extends \OC\Files\Storage\Common{
return $return; return $return;
} }
/**
* @param string $dir
*/
private function delTree($dir, $isLogicPath=true) { private function delTree($dir, $isLogicPath=true) {
$dirRelative=$dir; $dirRelative=$dir;
if ($isLogicPath) { if ($isLogicPath) {
@ -244,6 +247,9 @@ class MappedLocal extends \OC\Files\Storage\Common{
return $return; return $return;
} }
/**
* @param string $fullPath
*/
private static function getFileSizeFromOS($fullPath) { private static function getFileSizeFromOS($fullPath) {
$name = strtolower(php_uname('s')); $name = strtolower(php_uname('s'));
// Windows OS: we use COM to access the filesystem // Windows OS: we use COM to access the filesystem
@ -288,6 +294,9 @@ class MappedLocal extends \OC\Files\Storage\Common{
return $this->buildPath($path); return $this->buildPath($path);
} }
/**
* @param string $query
*/
protected function searchInDir($query, $dir='') { protected function searchInDir($query, $dir='') {
$files=array(); $files=array();
$physicalDir = $this->buildPath($dir); $physicalDir = $this->buildPath($dir);
@ -331,6 +340,10 @@ class MappedLocal extends \OC\Files\Storage\Common{
$this->mapper->removePath($fullPath, $isLogicPath, $recursive); $this->mapper->removePath($fullPath, $isLogicPath, $recursive);
} }
/**
* @param string $path1
* @param string $path2
*/
private function copyMapping($path1, $path2) { private function copyMapping($path1, $path2) {
$path1 = $this->stripLeading($path1); $path1 = $this->stripLeading($path1);
$path2 = $this->stripLeading($path2); $path2 = $this->stripLeading($path2);

View File

@ -23,6 +23,9 @@ class Quota extends Wrapper {
$this->quota = $parameters['quota']; $this->quota = $parameters['quota'];
} }
/**
* @param string $path
*/
protected function getSize($path) { protected function getSize($path) {
$cache = $this->getCache(); $cache = $this->getCache();
$data = $cache->get($path); $data = $cache->get($path);

View File

@ -94,6 +94,9 @@ class Close {
return unlink($path); return unlink($path);
} }
/**
* @param string $path
*/
public static function registerCallback($path, $callback) { public static function registerCallback($path, $callback) {
self::$callBacks[$path] = $callback; self::$callBacks[$path] = $callback;
} }

View File

@ -41,6 +41,9 @@ class Dir {
return true; return true;
} }
/**
* @param string $path
*/
public static function register($path, $content) { public static function register($path, $content) {
self::$dirs[$path] = $content; self::$dirs[$path] = $content;
} }

View File

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

View File

@ -48,7 +48,7 @@ class View {
* change the root to a fake root * change the root to a fake root
* *
* @param string $fakeRoot * @param string $fakeRoot
* @return bool * @return boolean|null
*/ */
public function chroot($fakeRoot) { public function chroot($fakeRoot) {
if (!$fakeRoot == '') { if (!$fakeRoot == '') {
@ -352,6 +352,9 @@ class View {
return $this->basicOperation('unlink', $path, array('delete')); return $this->basicOperation('unlink', $path, array('delete'));
} }
/**
* @param string $directory
*/
public function deleteAll($directory, $empty = false) { public function deleteAll($directory, $empty = false) {
return $this->rmdir($directory); return $this->rmdir($directory);
} }
@ -735,6 +738,9 @@ class View {
return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/'); return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
} }
/**
* @param string $path
*/
private function runHooks($hooks, $path, $post = false) { private function runHooks($hooks, $path, $post = false) {
$path = $this->getHookPath($path); $path = $this->getHookPath($path);
$prefix = ($post) ? 'post_' : ''; $prefix = ($post) ? 'post_' : '';

View File

@ -20,6 +20,7 @@ interface Emitter {
* @param string $scope * @param string $scope
* @param string $method * @param string $method
* @param callable $callback * @param callable $callback
* @return void
*/ */
public function listen($scope, $method, $callback); public function listen($scope, $method, $callback);
@ -27,6 +28,7 @@ interface Emitter {
* @param string $scope optional * @param string $scope optional
* @param string $method optional * @param string $method optional
* @param callable $callback optional * @param callable $callback optional
* @return void
*/ */
public function removeListener($scope = null, $method = null, $callback = null); public function removeListener($scope = null, $method = null, $callback = null);
} }

View File

@ -396,7 +396,7 @@ class OC_Image {
/** /**
* @brief Loads an image from an open file handle. * @brief Loads an image from an open file handle.
* It is the responsibility of the caller to position the pointer at the correct place and to close the handle again. * It is the responsibility of the caller to position the pointer at the correct place and to close the handle again.
* @param $handle * @param resource $handle
* @returns An image resource or false on error * @returns An image resource or false on error
*/ */
public function loadFromFileHandle($handle) { public function loadFromFileHandle($handle) {
@ -563,7 +563,7 @@ class OC_Image {
* Create a new image from file or URL * Create a new image from file or URL
* @link http://www.programmierer-forum.de/function-imagecreatefrombmp-laeuft-mit-allen-bitraten-t143137.htm * @link http://www.programmierer-forum.de/function-imagecreatefrombmp-laeuft-mit-allen-bitraten-t143137.htm
* @version 1.00 * @version 1.00
* @param string $filename <p> * @param string $fileName <p>
* Path to the BMP image. * Path to the BMP image.
* </p> * </p>
* @return resource an image resource identifier on success, <b>FALSE</b> on errors. * @return resource an image resource identifier on success, <b>FALSE</b> on errors.
@ -704,7 +704,7 @@ class OC_Image {
/** /**
* @brief Resizes the image preserving ratio. * @brief Resizes the image preserving ratio.
* @param $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) {
@ -891,8 +891,7 @@ if ( ! function_exists( 'imagebmp') ) {
* @link http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm * @link http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm
* @author mgutt <marc@gutt.it> * @author mgutt <marc@gutt.it>
* @version 1.00 * @version 1.00
* @param resource $image * @param string $fileName [optional] <p>The path to save the file to.</p>
* @param string $filename [optional] <p>The path to save the file to.</p>
* @param int $bit [optional] <p>Bit depth, (default is 24).</p> * @param int $bit [optional] <p>Bit depth, (default is 24).</p>
* @param int $compression [optional] * @param int $compression [optional]
* @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure. * @return bool <b>TRUE</b> on success or <b>FALSE</b> on failure.
@ -1008,7 +1007,7 @@ if ( ! function_exists( 'exif_imagetype' ) ) {
/** /**
* Workaround if exif_imagetype does not exist * Workaround if exif_imagetype does not exist
* @link http://www.php.net/manual/en/function.exif-imagetype.php#80383 * @link http://www.php.net/manual/en/function.exif-imagetype.php#80383
* @param string $filename * @param string $fileName
* @return string|boolean * @return string|boolean
*/ */
function exif_imagetype ( $fileName ) { function exif_imagetype ( $fileName ) {

View File

@ -55,6 +55,7 @@ class OC_Installer{
* *
* It is the task of oc_app_install to create the tables and do whatever is * It is the task of oc_app_install to create the tables and do whatever is
* needed to get the app working. * needed to get the app working.
* @return string
*/ */
public static function installApp( $data = array()) { public static function installApp( $data = array()) {
$l = \OC_L10N::get('lib'); $l = \OC_L10N::get('lib');
@ -270,7 +271,7 @@ class OC_Installer{
/** /**
* @brief Check if an update for the app is available * @brief Check if an update for the app is available
* @param $name name of the application * @param $name name of the application
* @return boolean 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
*/ */
@ -313,7 +314,7 @@ class OC_Installer{
/** /**
* @brief Removes an app * @brief Removes an app
* @param $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
* @returns true/false * @returns true/false
* *
@ -395,6 +396,7 @@ class OC_Installer{
* install an app already placed in the app folder * install an app already placed in the app folder
* @param string $app id of the app to install * @param string $app id of the app to install
* @returns array see OC_App::getAppInfo * @returns array see OC_App::getAppInfo
* @return string
*/ */
public static function installShippedApp($app) { public static function installShippedApp($app) {
//install the database //install the database

View File

@ -21,6 +21,7 @@ class OC_JSON{
/** /**
* Check if the app is enabled, send json error msg if not * Check if the app is enabled, send json error msg if not
* @param string $app
*/ */
public static function checkAppEnabled($app) { public static function checkAppEnabled($app) {
if( !OC_App::isEnabled($app)) { if( !OC_App::isEnabled($app)) {

View File

@ -529,6 +529,9 @@ class OC_L10N implements \OCP\IL10N {
return $available; return $available;
} }
/**
* @param string $lang
*/
public static function languageExists($app, $lang) { public static function languageExists($app, $lang) {
if ($lang == 'en') {//english is always available if ($lang == 'en') {//english is always available
return true; return true;

View File

@ -27,6 +27,9 @@ class OC_L10N_String{
*/ */
protected $count; protected $count;
/**
* @param OC_L10N $l10n
*/
public function __construct($l10n, $text, $parameters, $count = 1) { public function __construct($l10n, $text, $parameters, $count = 1) {
$this->l10n = $l10n; $this->l10n = $l10n;
$this->text = $text; $this->text = $text;

View File

@ -25,7 +25,7 @@ class OC_Mail {
* @param string $mailtext * @param string $mailtext
* @param string $fromaddress * @param string $fromaddress
* @param string $fromname * @param string $fromname
* @param bool|int $html * @param integer $html
* @param string $altbody * @param string $altbody
* @param string $ccaddress * @param string $ccaddress
* @param string $ccname * @param string $ccname

View File

@ -57,7 +57,7 @@ class Factory implements ICacheFactory {
* get a in-server cache instance, will return null if no backend is available * get a in-server cache instance, will return null if no backend is available
* *
* @param string $prefix * @param string $prefix
* @return \OC\Memcache\Cache * @return null|Cache
*/ */
public static function createLowLatency($prefix = '') { public static function createLowLatency($prefix = '') {
if (XCache::isAvailable()) { if (XCache::isAvailable()) {

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