From 5b7d86d07f3bd21618ebc4653268beed8b8c5f9c Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Fri, 26 Mar 2010 21:55:13 +0000 Subject: [PATCH] Fixed some doxygen warnings --- includes/filerepo/FSRepo.php | 24 ++++---- includes/filerepo/File.php | 4 +- includes/filerepo/FileRepo.php | 91 +++++++++++++++-------------- includes/filerepo/ForeignDBRepo.php | 2 +- includes/filerepo/Image.php | 6 +- includes/filerepo/LocalFile.php | 5 +- includes/filerepo/LocalRepo.php | 6 +- includes/filerepo/OldLocalFile.php | 2 +- includes/filerepo/RepoGroup.php | 13 +++-- 9 files changed, 79 insertions(+), 74 deletions(-) diff --git a/includes/filerepo/FSRepo.php b/includes/filerepo/FSRepo.php index 0dd9d0f74e..68f175e928 100644 --- a/includes/filerepo/FSRepo.php +++ b/includes/filerepo/FSRepo.php @@ -132,8 +132,8 @@ class FSRepo extends FileRepo { /** * Store a batch of files * - * @param array $triplets (src,zone,dest) triplets as per store() - * @param integer $flags Bitwise combination of the following flags: + * @param $triplets Array: (src,zone,dest) triplets as per store() + * @param $flags Integer: bitwise combination of the following flags: * self::DELETE_SOURCE Delete the source file after upload * self::OVERWRITE Overwrite an existing destination file instead of failing * self::OVERWRITE_SAME Overwrite the file if the destination exists and has the @@ -267,8 +267,8 @@ class FSRepo extends FileRepo { /** * Checks existence of specified array of files. * - * @param array $files URLs of files to check - * @param integer $flags Bitwise combination of the following flags: + * @param $files Array: URLs of files to check + * @param $flags Integer: bitwise combination of the following flags: * self::FILES_ONLY Mark file as existing only if it is a file (not directory) * @return Either array of files and existence flags, or false */ @@ -307,9 +307,9 @@ class FSRepo extends FileRepo { /** * Pick a random name in the temp zone and store a file to it. - * @param string $originalName The base name of the file as specified + * @param $originalName String: the base name of the file as specified * by the user. The file extension will be maintained. - * @param string $srcPath The current location of the file. + * @param $srcPath String: the current location of the file. * @return FileRepoStatus object with the URL in the value. */ function storeTemp( $originalName, $srcPath ) { @@ -325,8 +325,8 @@ class FSRepo extends FileRepo { /** * Remove a temporary file or mark it for garbage collection - * @param string $virtualUrl The virtual URL returned by storeTemp - * @return boolean True on success, false on failure + * @param $virtualUrl String: the virtual URL returned by storeTemp + * @return Boolean: true on success, false on failure */ function freeTemp( $virtualUrl ) { $temp = "mwrepo://{$this->name}/temp"; @@ -343,8 +343,8 @@ class FSRepo extends FileRepo { /** * Publish a batch of files - * @param array $triplets (source,dest,archive) triplets as per publish() - * @param integer $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate + * @param $triplets Array: (source,dest,archive) triplets as per publish() + * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate * that the source files should be deleted if possible */ function publishBatch( $triplets, $flags = 0 ) { @@ -454,7 +454,7 @@ class FSRepo extends FileRepo { * If no valid deletion archive is configured, this may either delete the * file or throw an exception, depending on the preference of the repository. * - * @param array $sourceDestPairs Array of source/destination pairs. Each element + * @param $sourceDestPairs Array of source/destination pairs. Each element * is a two-element array containing the source file path relative to the * public root in the first element, and the archive file path relative * to the deleted zone root in the second element. @@ -615,7 +615,7 @@ class FSRepo extends FileRepo { /** * Chmod a file, supressing the warnings. - * @param String $path The path to change + * @param $path String: the path to change */ protected function chmod( $path ) { wfSuppressWarnings(); diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index fdd61530c9..bf0810431b 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -501,7 +501,7 @@ abstract class File { /** * As createThumb, but returns a ThumbnailImage object. This can * provide access to the actual file, the real size of the thumb, - * and can produce a convenient tag for you. + * and can produce a convenient \ tag for you. * * For non-image formats, this may return a filetype-specific icon. * @@ -850,7 +850,7 @@ abstract class File { * The archive name should be passed through to recordUpload for database * registration. * - * @param $sourcePath String: local filesystem path to the source image + * @param $srcPath String: local filesystem path to the source image * @param $flags Integer: a bitwise combination of: * File::DELETE_SOURCE Delete the source file, i.e. move * rather than copy diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index f94709b3a5..b9ed41f5e3 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -49,12 +49,13 @@ abstract class FileRepo { /** * Create a new File object from the local repository - * @param mixed $title Title object or string - * @param mixed $time Time at which the image was uploaded. - * If this is specified, the returned object will be an - * instance of the repository's old file class instead of - * a current file. Repositories not supporting version - * control should return false if this parameter is set. + * + * @param $title Mixed: Title object or string + * @param $time Mixed: Time at which the image was uploaded. + * If this is specified, the returned object will be an + * instance of the repository's old file class instead of a + * current file. Repositories not supporting version control + * should return false if this parameter is set. */ function newFile( $title, $time = false ) { if ( !($title instanceof Title) ) { @@ -79,7 +80,7 @@ abstract class FileRepo { * Returns false if the file does not exist. Repositories not supporting * version control should return false if the time is specified. * - * @param mixed $title Title object or string + * @param $title Mixed: Title object or string * @param $options Associative array of options: * time: requested time for an archived image, or false for the * current version. An image object will be returned which was @@ -144,7 +145,7 @@ abstract class FileRepo { /* * Find many files at once. - * @param array $items, an array of titles, or an array of findFile() options with + * @param $items An array of titles, or an array of findFile() options with * the "title" option giving the title. Example: * * $findItem = array( 'title' => $title, 'private' => true ); @@ -171,12 +172,12 @@ abstract class FileRepo { /** * Create a new File object from the local repository - * @param mixed $sha1 SHA-1 key - * @param mixed $time Time at which the image was uploaded. - * If this is specified, the returned object will be an - * instance of the repository's old file class instead of - * a current file. Repositories not supporting version - * control should return false if this parameter is set. + * @param $sha1 Mixed: SHA-1 key + * @param $time Mixed: time at which the image was uploaded. + * If this is specified, the returned object will be an + * of the repository's old file class instead of a current + * file. Repositories not supporting version control should + * return false if this parameter is set. */ function newFileFromKey( $sha1, $time = false ) { if ( $time ) { @@ -195,8 +196,8 @@ abstract class FileRepo { * Returns false if the file does not exist. Repositories not supporting * version control should return false if the time is specified. * - * @param string $sha1 string - * @param array $options Option array, same as findFile(). + * @param $sha1 String + * @param $options Option array, same as findFile(). */ function findFileFromKey( $sha1, $options = array() ) { if ( !is_array( $options ) ) { @@ -237,7 +238,7 @@ abstract class FileRepo { /** * Get the URL corresponding to one of the four basic zones - * @param String $zone One of: public, deleted, temp, thumb + * @param $zone String: one of: public, deleted, temp, thumb * @return String or false */ function getZoneUrl( $zone ) { @@ -336,8 +337,8 @@ abstract class FileRepo { * MediaWiki this means action=render. This should only be called by the * repository's file class, since it may return invalid results. User code * should use File::getDescriptionText(). - * @param string $name Name of image to fetch - * @param string $lang Language to fetch it in, if any. + * @param $name String: name of image to fetch + * @param $lang String: language to fetch it in, if any. */ function getDescriptionRenderUrl( $name, $lang = null ) { $query = 'action=render'; @@ -361,10 +362,10 @@ abstract class FileRepo { /** * Store a file to a given destination. * - * @param string $srcPath Source path or virtual URL - * @param string $dstZone Destination zone - * @param string $dstRel Destination relative path - * @param integer $flags Bitwise combination of the following flags: + * @param $srcPath String: source path or virtual URL + * @param $dstZone String: destination zone + * @param $dstRel String: destination relative path + * @param $flags Integer: bitwise combination of the following flags: * self::DELETE_SOURCE Delete the source file after upload * self::OVERWRITE Overwrite an existing destination file instead of failing * self::OVERWRITE_SAME Overwrite the file if the destination exists and has the @@ -382,8 +383,8 @@ abstract class FileRepo { /** * Store a batch of files * - * @param array $triplets (src,zone,dest) triplets as per store() - * @param integer $flags Flags as per store + * @param $triplets Array: (src,zone,dest) triplets as per store() + * @param $flags Integer: flags as per store */ abstract function storeBatch( $triplets, $flags = 0 ); @@ -391,18 +392,18 @@ abstract class FileRepo { * Pick a random name in the temp zone and store a file to it. * Returns a FileRepoStatus object with the URL in the value. * - * @param string $originalName The base name of the file as specified + * @param $originalName String: the base name of the file as specified * by the user. The file extension will be maintained. - * @param string $srcPath The current location of the file. + * @param $srcPath String: the current location of the file. */ abstract function storeTemp( $originalName, $srcPath ); /** * Append the contents of the source path to the given file. - * @param $srcPath string location of the source file - * @param $toAppendPath string path to append to. - * @param $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate + * @param $srcPath String: location of the source file + * @param $toAppendPath String: path to append to. + * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate * that the source file should be deleted if possible * @return mixed Status or false */ @@ -410,8 +411,8 @@ abstract class FileRepo { /** * Remove a temporary file or mark it for garbage collection - * @param string $virtualUrl The virtual URL returned by storeTemp - * @return boolean True on success, false on failure + * @param $virtualUrl String: the virtual URL returned by storeTemp + * @return Boolean: true on success, false on failure * STUB */ function freeTemp( $virtualUrl ) { @@ -425,11 +426,11 @@ abstract class FileRepo { * Returns a FileRepoStatus object. On success, the value contains "new" or * "archived", to indicate whether the file was new with that name. * - * @param string $srcPath The source path or URL - * @param string $dstRel The destination relative path - * @param string $archiveRel The relative path where the existing file is to + * @param $srcPath String: the source path or URL + * @param $dstRel String: the destination relative path + * @param $archiveRel String: rhe relative path where the existing file is to * be archived, if there is one. Relative to the public zone root. - * @param integer $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate + * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate * that the source file should be deleted if possible */ function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { @@ -447,8 +448,8 @@ abstract class FileRepo { /** * Publish a batch of files - * @param array $triplets (source,dest,archive) triplets as per publish() - * @param integer $flags Bitfield, may be FileRepo::DELETE_SOURCE to indicate + * @param $triplets Array: (source,dest,archive) triplets as per publish() + * @param $flags Integer: bitfield, may be FileRepo::DELETE_SOURCE to indicate * that the source files should be deleted if possible */ abstract function publishBatch( $triplets, $flags = 0 ); @@ -461,8 +462,8 @@ abstract class FileRepo { /** * Checks existence of an array of files. * - * @param array $files URLs (or paths) of files to check - * @param integer $flags Bitwise combination of the following flags: + * @param $files Array: URLs (or paths) of files to check + * @param $flags Integer: bitwise combination of the following flags: * self::FILES_ONLY Mark file as existing only if it is a file (not directory) * @return Either array of files and existence flags, or false */ @@ -478,7 +479,7 @@ abstract class FileRepo { * assumes a naming scheme in the deleted zone based on content hash, as * opposed to the public zone which is assumed to be unique. * - * @param array $sourceDestPairs Array of source/destination pairs. Each element + * @param $sourceDestPairs Array of source/destination pairs. Each element * is a two-element array containing the source file path relative to the * public root in the first element, and the archive file path relative * to the deleted zone root in the second element. @@ -490,8 +491,8 @@ abstract class FileRepo { * Move a file to the deletion archive. * If no valid deletion archive exists, this may either delete the file * or throw an exception, depending on the preference of the repository - * @param mixed $srcRel Relative path for the file to be deleted - * @param mixed $archiveRel Relative path for the archive location. + * @param $srcRel Mixed: relative path for the file to be deleted + * @param $archiveRel Mixed: relative path for the archive location. * Relative to a private archive directory. * @return WikiError object (wikitext-formatted), or true for success */ @@ -589,7 +590,7 @@ abstract class FileRepo { * title object. If not, return false. * STUB * - * @param Title $title Title of image + * @param $title Title of image */ function checkRedirect( $title ) { return false; @@ -600,7 +601,7 @@ abstract class FileRepo { * Doesn't do anything for repositories that don't support image redirects. * * STUB - * @param Title $title Title of image + * @param $title Title of image */ function invalidateImageRedirect( $title ) {} diff --git a/includes/filerepo/ForeignDBRepo.php b/includes/filerepo/ForeignDBRepo.php index 35c2c4bf11..df3fde90b5 100644 --- a/includes/filerepo/ForeignDBRepo.php +++ b/includes/filerepo/ForeignDBRepo.php @@ -65,7 +65,7 @@ class ForeignDBRepo extends LocalRepo { function publish( $srcPath, $dstRel, $archiveRel, $flags = 0 ) { throw new MWException( get_class($this) . ': write operations are not supported' ); } - function deleteBatch( $fileMap ) { + function deleteBatch( $sourceDestPairs ) { throw new MWException( get_class($this) . ': write operations are not supported' ); } } diff --git a/includes/filerepo/Image.php b/includes/filerepo/Image.php index 08ce219a15..18643f86db 100644 --- a/includes/filerepo/Image.php +++ b/includes/filerepo/Image.php @@ -30,7 +30,7 @@ class Image extends LocalFile { * Wrapper for wfFindFile(), for backwards-compatibility only. * Do not use in core code. * - * @param string $name name of the image, used to create a title object using Title::makeTitleSafe + * @param $name String: name of the image, used to create a title object using Title::makeTitleSafe * @return image object or null if invalid title * @deprecated */ @@ -55,8 +55,8 @@ class Image extends LocalFile { * Note that fromSharedDirectory will only use the shared path for files * that actually exist there now, and will return local paths otherwise. * - * @param string $name Name of the image, without the leading "Image:" - * @param boolean $fromSharedDirectory Should this be in $wgSharedUploadPath? + * @param $name String: name of the image, without the leading "Image:" + * @param $fromSharedDirectory Boolean: Should this be in $wgSharedUploadPath? * @return string URL of $name image * @deprecated */ diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index b17214ee39..29c6b7adbf 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -747,7 +747,8 @@ class LocalFile extends File { * @param $props Array: File properties, if known. This can be used to reduce the * upload time when uploading virtual URLs for which the file info * is already known - * @param string $timestamp Timestamp for img_timestamp, or false to use the current time + * @param $timestamp String: timestamp for img_timestamp, or false to use the current time + * @param $user Mixed: User object or null to use $wgUser * * @return FileRepoStatus object. On success, the value member contains the * archive name, or an empty string if it was a new file. @@ -954,7 +955,7 @@ class LocalFile extends File { * The archive name should be passed through to recordUpload for database * registration. * - * @param $sourcePath String: local filesystem path to the source image + * @param $srcPath String: local filesystem path to the source image * @param $flags Integer: a bitwise combination of: * File::DELETE_SOURCE Delete the source file, i.e. move * rather than copy diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 6c4d21a26c..62386a110d 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -71,7 +71,7 @@ class LocalRepo extends FSRepo { /** * Checks if there is a redirect named as $title * - * @param Title $title Title of image + * @param $title Title of file */ function checkRedirect( $title ) { global $wgMemc; @@ -189,8 +189,8 @@ class LocalRepo extends FSRepo { /** * Invalidates image redirect cache related to that image * - * @param Title $title Title of image - */ + * @param $title Title of page + */ function invalidateImageRedirect( $title ) { global $wgMemc; $memcKey = $this->getSharedCacheKey( 'image_redirect', md5( $title->getDBkey() ) ); diff --git a/includes/filerepo/OldLocalFile.php b/includes/filerepo/OldLocalFile.php index 6a245c29c0..d6cc709d45 100644 --- a/includes/filerepo/OldLocalFile.php +++ b/includes/filerepo/OldLocalFile.php @@ -73,7 +73,7 @@ class OldLocalFile extends LocalFile { * @param $title Title * @param $repo FileRepo * @param $time String: timestamp or null to load by archive name - * @param $archiveNameString: archive name or null to load by timestamp + * @param $archiveName String: archive name or null to load by timestamp */ function __construct( $title, $repo, $time, $archiveName ) { parent::__construct( $title, $repo ); diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 1465400c79..2594a8f390 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -48,7 +48,9 @@ class RepoGroup { /** * Construct a group of file repositories. - * @param array $data Array of repository info arrays. + * + * @param $localInfo Associative array for local repo's info + * @param $foreignInfo Array of repository info arrays. * Each info array is an associative array with the 'class' member * giving the class name. The entire array is passed to the repository * constructor as the first parameter. @@ -62,7 +64,8 @@ class RepoGroup { /** * Search repositories for an image. * You can also use wfFindFile() to do this. - * @param mixed $title Title object or string + * + * @param $title Mixed: Title object or string * @param $options Associative array of options: * time: requested time for an archived image, or false for the * current version. An image object will be returned which was @@ -243,8 +246,8 @@ class RepoGroup { * Call a function for each foreign repo, with the repo object as the * first parameter. * - * @param $callback callback The function to call - * @param $params array Optional additional parameters to pass to the function + * @param $callback Callback: the function to call + * @param $params Array: optional additional parameters to pass to the function */ function forEachForeignRepo( $callback, $params = array() ) { foreach( $this->foreignRepos as $repo ) { @@ -258,7 +261,7 @@ class RepoGroup { /** * Does the installation have any foreign repos set up? - * @return bool + * @return Boolean */ function hasForeignRepos() { return (bool)$this->foreignRepos; -- 2.20.1