From 957adbef22cabe18bbbe56258470979825d10108 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 19 Apr 2014 17:19:17 +0200 Subject: [PATCH] Fixed some @params documentation (includes/[file...|upload]) Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I8804ebe0922d3a414863b162a2110e0b9e49b80f --- includes/filebackend/FSFile.php | 2 +- includes/filebackend/FSFileBackend.php | 2 +- includes/filebackend/FileBackend.php | 14 +- includes/filebackend/FileBackendStore.php | 12 +- includes/filebackend/FileOp.php | 2 +- includes/filebackend/SwiftFileBackend.php | 4 +- .../filebackend/filejournal/FileJournal.php | 6 +- .../filebackend/lockmanager/DBLockManager.php | 2 +- includes/filerepo/FileRepo.php | 18 +- includes/filerepo/FileRepoStatus.php | 2 +- includes/filerepo/ForeignAPIRepo.php | 8 +- includes/filerepo/RepoGroup.php | 16 +- includes/filerepo/file/File.php | 54 +++--- includes/filerepo/file/ForeignAPIFile.php | 6 +- includes/filerepo/file/ForeignDBFile.php | 16 +- includes/filerepo/file/LocalFile.php | 25 ++- includes/upload/UploadBase.php | 158 +++++++++--------- includes/upload/UploadFromChunks.php | 27 +-- includes/upload/UploadFromFile.php | 8 +- includes/upload/UploadFromUrl.php | 48 +++--- includes/upload/UploadStash.php | 20 +-- 21 files changed, 234 insertions(+), 216 deletions(-) diff --git a/includes/filebackend/FSFile.php b/includes/filebackend/FSFile.php index 34f6b51b8e..4575e7c56c 100644 --- a/includes/filebackend/FSFile.php +++ b/includes/filebackend/FSFile.php @@ -45,7 +45,7 @@ class FSFile { /** * Returns the file system path * - * @return String + * @return string */ public function getPath() { return $this->path; diff --git a/includes/filebackend/FSFileBackend.php b/includes/filebackend/FSFileBackend.php index 8438919a04..2b184436fb 100644 --- a/includes/filebackend/FSFileBackend.php +++ b/includes/filebackend/FSFileBackend.php @@ -454,7 +454,7 @@ class FSFileBackend extends FileBackendStore { /** * @param string $fullCont - * @param $dirRel + * @param string $dirRel * @param array $params * @return Status */ diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index c75972562c..79c17aa60d 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -207,7 +207,7 @@ abstract class FileBackend { /** * Get the a bitfield of extra features supported by the backend medium * - * @return integer Bitfield of FileBackend::ATTR_* flags + * @return int Bitfield of FileBackend::ATTR_* flags * @since 1.23 */ public function getFeatures() { @@ -217,7 +217,7 @@ abstract class FileBackend { /** * Check if the backend medium supports a field of extra features * - * @return integer Bitfield of FileBackend::ATTR_* flags + * @return int Bitfield of FileBackend::ATTR_* flags * @return bool * @since 1.23 */ @@ -941,7 +941,7 @@ abstract class FileBackend { * $params include: * - src : source storage path * - latest : use the latest available data - * @return Array|bool Returns false on failure + * @return array|bool Returns false on failure * @since 1.23 */ abstract public function getFileXAttributes( array $params ); @@ -1128,7 +1128,7 @@ abstract class FileBackend { * @param array $params Parameters include: * - dir : storage directory * - topOnly : only return direct child dirs of the directory - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure * @since 1.20 */ abstract public function getDirectoryList( array $params ); @@ -1143,7 +1143,7 @@ abstract class FileBackend { * * @param array $params Parameters include: * - dir : storage directory - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure * @since 1.20 */ final public function getTopDirectoryList( array $params ) { @@ -1166,7 +1166,7 @@ abstract class FileBackend { * - dir : storage directory * - topOnly : only return direct child files of the directory (since 1.20) * - adviseStat : set to true if stat requests will be made on the files (since 1.22) - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure */ abstract public function getFileList( array $params ); @@ -1181,7 +1181,7 @@ abstract class FileBackend { * @param array $params Parameters include: * - dir : storage directory * - adviseStat : set to true if stat requests will be made on the files (since 1.22) - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure * @since 1.20 */ final public function getTopFileList( array $params ) { diff --git a/includes/filebackend/FileBackendStore.php b/includes/filebackend/FileBackendStore.php index 368bf16c26..57760137c2 100644 --- a/includes/filebackend/FileBackendStore.php +++ b/includes/filebackend/FileBackendStore.php @@ -464,7 +464,7 @@ abstract class FileBackendStore extends FileBackend { /** * @see FileBackendStore::doPrepare() - * @param $container + * @param string $container * @param string $dir * @param array $params * @return Status @@ -499,7 +499,7 @@ abstract class FileBackendStore extends FileBackend { /** * @see FileBackendStore::doSecure() - * @param $container + * @param string $container * @param string $dir * @param array $params * @return Status @@ -534,7 +534,7 @@ abstract class FileBackendStore extends FileBackend { /** * @see FileBackendStore::doPublish() - * @param $container + * @param string $container * @param string $dir * @param array $params * @return Status @@ -590,7 +590,7 @@ abstract class FileBackendStore extends FileBackend { /** * @see FileBackendStore::doClean() - * @param $container + * @param string $container * @param string $dir * @param array $params * @return Status @@ -962,7 +962,7 @@ abstract class FileBackendStore extends FileBackend { * @param string $container Resolved container name * @param string $dir Resolved path relative to container * @param array $params - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure */ abstract public function getDirectoryListInternal( $container, $dir, array $params ); @@ -992,7 +992,7 @@ abstract class FileBackendStore extends FileBackend { * @param string $container Resolved container name * @param string $dir Resolved path relative to container * @param array $params - * @return Traversable|Array|null Returns null on failure + * @return Traversable|array|null Returns null on failure */ abstract public function getFileListInternal( $container, $dir, array $params ); diff --git a/includes/filebackend/FileOp.php b/includes/filebackend/FileOp.php index 4e03675510..66d879433a 100644 --- a/includes/filebackend/FileOp.php +++ b/includes/filebackend/FileOp.php @@ -178,7 +178,7 @@ abstract class FileOp { * Check if this operation changes files listed in $paths * * @param array $deps Prior path reads/writes; format of FileOp::newPredicates() - * @return boolean + * @return bool */ final public function dependsOn( array $deps ) { foreach ( $this->storagePathsChanged() as $path ) { diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 174f9f3622..cae407919e 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -1394,7 +1394,7 @@ class SwiftFileBackend extends FileBackendStore { * * @param string $fullCont * @param string $type ('info' for a list of object detail maps, 'names' for names only) - * @param integer $limit + * @param int $limit * @param string|null $after * @param string|null $prefix * @param string|null $delim @@ -1641,7 +1641,7 @@ class SwiftFileBackend extends FileBackendStore { * @param string $func * @param array $params * @param string $err Error string - * @param integer $code HTTP status + * @param int $code HTTP status * @param string $desc HTTP status description */ public function onError( $status, $func, array $params, $err = '', $code = 0, $desc = '' ) { diff --git a/includes/filebackend/filejournal/FileJournal.php b/includes/filebackend/filejournal/FileJournal.php index 0464e03804..20c7c354e0 100644 --- a/includes/filebackend/filejournal/FileJournal.php +++ b/includes/filebackend/filejournal/FileJournal.php @@ -150,9 +150,9 @@ abstract class FileJournal { * Get an array of file change log entries. * A starting change ID and/or limit can be specified. * - * @param $start integer Starting change ID or null - * @param $limit integer Maximum number of items to return - * @param &$next string Updated to the ID of the next entry. + * @param int $start Starting change ID or null + * @param int $limit Maximum number of items to return + * @param string &$next Updated to the ID of the next entry. * @return array List of associative arrays, each having: * id : unique, monotonic, ID for this change * batch_uuid : UUID for an operation batch diff --git a/includes/filebackend/lockmanager/DBLockManager.php b/includes/filebackend/lockmanager/DBLockManager.php index 4418a83069..b58e901600 100644 --- a/includes/filebackend/lockmanager/DBLockManager.php +++ b/includes/filebackend/lockmanager/DBLockManager.php @@ -195,7 +195,7 @@ abstract class DBLockManager extends QuorumLockManager { * Checks if the DB has not recently had connection/query errors. * This just avoids wasting time on doomed connection attempts. * - * @param $lockDb string + * @param string $lockDb * @return bool */ protected function cacheCheckFailures( $lockDb ) { diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 888af377be..1fc91d8a23 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -52,7 +52,7 @@ class FileRepo { /** @var FileBackend */ protected $backend; - /** @var Array Map of zones to config */ + /** @var array Map of zones to config */ protected $zones = array(); /** @var string URL of thumb.php */ @@ -305,7 +305,7 @@ class FileRepo { * from the URL path, one can configure thumb_handler.php to recognize a special path on the * same host name as the wiki that is used for viewing thumbnails. * - * @param string $zone one of: public, deleted, temp, thumb + * @param string $zone One of: public, deleted, temp, thumb * @return string|bool String or false */ public function getZoneHandlerUrl( $zone ) { @@ -966,7 +966,7 @@ class FileRepo { * * @param string $src Source file system path, storage path, or virtual URL * @param string $dst Virtual URL or storage path - * @param Array|string|null $options An array consisting of a key named headers + * @param array|string|null $options An array consisting of a key named headers * listing extra headers. If a string, taken as content-disposition header. * (Support for array of options new in 1.23) * @return FileRepoStatus @@ -1381,7 +1381,7 @@ class FileRepo { * @param mixed $srcRel Relative path for the file to be deleted * @param mixed $archiveRel Relative path for the archive location. * Relative to a private archive directory. - * @return FileRepoStatus object + * @return FileRepoStatus */ public function delete( $srcRel, $archiveRel ) { $this->assertWritableRepo(); // fail out if read-only @@ -1536,7 +1536,7 @@ class FileRepo { * Properties should ultimately be obtained via FSFile::getProps(). * * @param string $virtualUrl - * @return Array + * @return array */ public function getFileProps( $virtualUrl ) { $path = $this->resolveToStoragePath( $virtualUrl ); @@ -1560,7 +1560,7 @@ class FileRepo { * Get the size of a file with a given virtual URL/storage path * * @param string $virtualUrl - * @return integer|bool False on failure + * @return int|bool False on failure */ public function getFileSize( $virtualUrl ) { $path = $this->resolveToStoragePath( $virtualUrl ); @@ -1635,7 +1635,7 @@ class FileRepo { /** * Determine if a relative path is valid, i.e. not blank or involving directory traveral * - * @param $filename string + * @param string $filename * @return bool */ public function validateFilename( $filename ) { @@ -1686,7 +1686,7 @@ class FileRepo { /** * Create a new fatal error * - * @param $message + * @param string $message * @return FileRepoStatus */ public function newFatal( $message /*, parameters...*/ ) { @@ -1747,7 +1747,7 @@ class FileRepo { * Get the portion of the file that contains the origin file name. * If that name is too long, then the name "thumbnail." will be given. * - * @param $name string + * @param string $name * @return string */ public function nameForThumb( $name ) { diff --git a/includes/filerepo/FileRepoStatus.php b/includes/filerepo/FileRepoStatus.php index 4be38bf287..56848df286 100644 --- a/includes/filerepo/FileRepoStatus.php +++ b/includes/filerepo/FileRepoStatus.php @@ -43,7 +43,7 @@ class FileRepoStatus extends Status { /** * @param FileRepo|bool $repo Default: false - * @param $value + * @param mixed $value * @return FileRepoStatus */ static function newGood( $repo = false, $value = null ) { diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 35ac60f5b1..7f25a00e77 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -66,7 +66,7 @@ class ForeignAPIRepo extends FileRepo { private $mQueryCache = array(); /** - * @param $info array|null + * @param array|null $info */ function __construct( $info ) { global $wgLocalFileRepo; @@ -319,7 +319,7 @@ class ForeignAPIRepo extends FileRepo { * If the url has been requested today, get it from cache * Otherwise retrieve remote thumb url, check for local file. * - * @param string $name is a dbkey form of a title + * @param string $name Is a dbkey form of a title * @param int $width * @param int $height * @param string $params Other rendering parameters (page number, etc) @@ -418,7 +418,7 @@ class ForeignAPIRepo extends FileRepo { * @see FileRepo::getZoneUrl() * @param string $zone * @param string|null $ext Optional file extension - * @return String + * @return string */ function getZoneUrl( $zone, $ext = null ) { switch ( $zone ) { @@ -501,7 +501,7 @@ class ForeignAPIRepo extends FileRepo { * @param string $url * @param string $timeout * @param array $options - * @return bool|String + * @return bool|string */ public static function httpGet( $url, $timeout = 'default', $options = array() ) { $options['timeout'] = $timeout; diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 18432a1572..103e78eb7b 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -90,7 +90,7 @@ class RepoGroup { * Construct a group of file repositories. * * @param array $localInfo Associative array for local repo's info - * @param array $foreignInfo of repository info arrays. + * @param array $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. @@ -105,7 +105,7 @@ class RepoGroup { * Search repositories for an image. * You can also use wfFindFile() to do this. * - * @param $title Title|string Title object or string + * @param Title|string $title Title object or string * @param array $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 @@ -185,7 +185,7 @@ class RepoGroup { * @return array Map of (file name => File objects) for matches * * @param array $inputItems - * @param integer $flags + * @param int $flags * @return array */ function findFiles( array $inputItems, $flags = 0 ) { @@ -220,7 +220,7 @@ class RepoGroup { /** * Interface for FileRepo::checkRedirect() - * @param $title Title + * @param Title $title * @return bool */ function checkRedirect( Title $title ) { @@ -247,9 +247,9 @@ class RepoGroup { * Find an instance of the file with this key, created at the specified time * Returns false if the file does not exist. * - * @param string $hash base 36 SHA-1 hash + * @param string $hash Base 36 SHA-1 hash * @param array $options Option array, same as findFile() - * @return File object or false if it is not found + * @return File|bool File object or false if it is not found */ function findFileFromKey( $hash, $options = array() ) { if ( !$this->reposInitialised ) { @@ -273,7 +273,7 @@ class RepoGroup { * Find all instances of files with this key * * @param string $hash base 36 SHA-1 hash - * @return Array of File objects + * @return array Array of File objects */ function findBySha1( $hash ) { if ( !$this->reposInitialised ) { @@ -293,7 +293,7 @@ class RepoGroup { * Find all instances of files with this keys * * @param array $hashes base 36 SHA-1 hashes - * @return array of array of File objects + * @return array Array of array of File objects */ function findBySha1s( array $hashes ) { if ( !$this->reposInitialised ) { diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 21ff65cd70..fb20e964d0 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -503,7 +503,7 @@ abstract class File { * format does not support that sort of thing, returns * an empty array. * - * @return Array + * @return array * @since 1.23 */ public function getAvailableLanguages() { @@ -519,7 +519,7 @@ abstract class File { * In files that support multiple language, what is the default language * to use if none specified. * - * @return String lang code, or null if filetype doesn't support multiple languages. + * @return string Lang code, or null if filetype doesn't support multiple languages. * @since 1.23 */ public function getDefaultRenderLanguage() { @@ -853,7 +853,7 @@ abstract class File { * Use File::THUMB_FULL_NAME to always get a name like "-". * Otherwise, the format may be "-" or "-thumbnail.". * - * @param array $params handler-specific parameters + * @param array $params Handler-specific parameters * @param int $flags Bitfield that supports THUMB_* constants * @return string */ @@ -941,7 +941,7 @@ abstract class File { /** * Transform a media file * - * @param array $params an associative array of handler-specific parameters. + * @param array $params An associative array of handler-specific parameters. * Typical keys are width, height and page. * @param int $flags A bitfield, may contain self::RENDER_NOW to force rendering * @return MediaTransformOutput|bool False on failure @@ -1188,8 +1188,8 @@ abstract class File { * * STUB * @param int $limit Limit of rows to return - * @param string $start timestamp Only revisions older than $start will be returned - * @param string $end timestamp Only revisions newer than $end will be returned + * @param string $start Only revisions older than $start will be returned + * @param string $end Only revisions newer than $end will be returned * @param bool $inc Include the endpoints of the time range * * @return array @@ -1249,7 +1249,7 @@ abstract class File { /** * Get the path of an archived file relative to the public zone root * - * @param bool|string $suffix if not false, the name of an archived thumbnail file + * @param bool|string $suffix If not false, the name of an archived thumbnail file * * @return string */ @@ -1268,7 +1268,7 @@ abstract class File { * Get the path, relative to the thumbnail zone root, of the * thumbnail directory or a particular file if $suffix is specified * - * @param bool|string $suffix if not false, the name of a thumbnail file + * @param bool|string $suffix If not false, the name of a thumbnail file * @return string */ function getThumbRel( $suffix = false ) { @@ -1294,8 +1294,8 @@ abstract class File { * Get the path, relative to the thumbnail zone root, for an archived file's thumbs directory * or a specific thumb if the $suffix is given. * - * @param string $archiveName the timestamped name of an archived image - * @param bool|string $suffix if not false, the name of a thumbnail file + * @param string $archiveName The timestamped name of an archived image + * @param bool|string $suffix If not false, the name of a thumbnail file * @return string */ function getArchiveThumbRel( $archiveName, $suffix = false ) { @@ -1312,7 +1312,7 @@ abstract class File { /** * Get the path of the archived file. * - * @param bool|string $suffix if not false, the name of an archived file. + * @param bool|string $suffix If not false, the name of an archived file. * @return string */ function getArchivePath( $suffix = false ) { @@ -1324,8 +1324,8 @@ abstract class File { /** * Get the path of an archived file's thumbs, or a particular thumb if $suffix is specified * - * @param string $archiveName the timestamped name of an archived image - * @param bool|string $suffix if not false, the name of a thumbnail file + * @param string $archiveName The timestamped name of an archived image + * @param bool|string $suffix If not false, the name of a thumbnail file * @return string */ function getArchiveThumbPath( $archiveName, $suffix = false ) { @@ -1381,7 +1381,7 @@ abstract class File { /** * Get the URL of the archived file's thumbs, or a particular thumb if $suffix is specified * - * @param string $archiveName the timestamped name of an archived image + * @param string $archiveName The timestamped name of an archived image * @param bool|string $suffix If not false, the name of a thumbnail file * @return string */ @@ -1402,7 +1402,7 @@ abstract class File { /** * Get the URL of the zone directory, or a particular file if $suffix is specified * - * @param string $zone name of requested zone + * @param string $zone Name of requested zone * @param bool|string $suffix If not false, the name of a file in zone * @return string path */ @@ -1420,7 +1420,7 @@ abstract class File { /** * Get the URL of the thumbnail directory, or a particular file if $suffix is specified * - * @param bool|string $suffix if not false, the name of a thumbnail file + * @param bool|string $suffix If not false, the name of a thumbnail file * @return string path */ function getThumbUrl( $suffix = false ) { @@ -1507,8 +1507,8 @@ abstract class File { * Record a file upload in the upload log and the image table * STUB * Overridden by LocalFile - * @param $oldver - * @param $desc + * @param string $oldver + * @param string $desc * @param string $license * @param string $copyStatus * @param string $source @@ -1535,7 +1535,7 @@ abstract class File { * Options to $options include: * - headers : name/value map of HTTP headers to use in response to GET/HEAD requests * - * @param string $srcPath local filesystem path to the source image + * @param string $srcPath Local filesystem path to the source image * @param int $flags A bitwise combination of: * File::DELETE_SOURCE Delete the source file, i.e. move rather than copy * @param array $options Optional additional parameters @@ -1601,7 +1601,7 @@ abstract class File { * Is this file a "deleted" file in a private archive? * STUB * - * @param int $field one of DELETED_* bitfield constants + * @param int $field One of DELETED_* bitfield constants * @return bool */ function isDeleted( $field ) { @@ -1638,7 +1638,7 @@ abstract class File { * and logging are caller's responsibility * * @param Title $target New file name - * @return FileRepoStatus object. + * @return FileRepoStatus */ function move( $target ) { $this->readOnlyError(); @@ -1654,7 +1654,7 @@ abstract class File { * * @param string $reason * @param bool $suppress Hide content from sysops? - * @return bool on success, false on some kind of failure + * @return bool Boolean on success, false on some kind of failure * STUB * Overridden by LocalFile */ @@ -1668,10 +1668,10 @@ abstract class File { * * May throw database exceptions on error. * - * @param array $versions set of record ids of deleted items to restore, + * @param array $versions Set of record ids of deleted items to restore, * or empty to restore all revisions. - * @param bool $unsuppress remove restrictions on content upon restoration? - * @return int|bool the number of file revisions restored if successful, + * @param bool $unsuppress Remove restrictions on content upon restoration? + * @return int|bool The number of file revisions restored if successful, * or false on failure * STUB * Overridden by LocalFile @@ -1869,7 +1869,7 @@ abstract class File { /** * Get an associative array containing information about a file in the local filesystem. * - * @param string $path absolute local filesystem path + * @param string $path Absolute local filesystem path * @param string|bool $ext The file extension, or true to extract it from * the filename. Set it to false to ignore the extension. * @@ -1892,7 +1892,7 @@ abstract class File { * 160 log 2 / log 36 = 30.95, so the 160-bit hash fills 31 digits in base 36 * fairly neatly. * - * @param $path string + * @param string $path * @return bool|string False on failure * @deprecated since 1.19 */ diff --git a/includes/filerepo/file/ForeignAPIFile.php b/includes/filerepo/file/ForeignAPIFile.php index 690d1b854b..3d5d5d60e5 100644 --- a/includes/filerepo/file/ForeignAPIFile.php +++ b/includes/filerepo/file/ForeignAPIFile.php @@ -33,9 +33,9 @@ class ForeignAPIFile extends File { protected $repoClass = 'ForeignApiRepo'; /** - * @param $title + * @param Title|string|bool $title * @param ForeignApiRepo $repo - * @param $info + * @param array $info * @param bool $exists */ function __construct( $title, $repo, $info, $exists = false ) { @@ -236,7 +236,7 @@ class ForeignAPIFile extends File { } /** - * @return null|String + * @return null|string */ function getSha1() { return isset( $this->mInfo['sha1'] ) diff --git a/includes/filerepo/file/ForeignDBFile.php b/includes/filerepo/file/ForeignDBFile.php index 36558c4c9b..c5ff4a77fc 100644 --- a/includes/filerepo/file/ForeignDBFile.php +++ b/includes/filerepo/file/ForeignDBFile.php @@ -65,14 +65,14 @@ class ForeignDBFile extends LocalFile { } /** - * @param $oldver - * @param $desc string - * @param $license string - * @param $copyStatus string - * @param $source string - * @param $watch bool - * @param $timestamp bool|string - * @param $user User object or null to use $wgUser + * @param string $oldver + * @param string $desc + * @param string $license + * @param string $copyStatus + * @param string $source + * @param bool $watch + * @param bool|string $timestamp + * @param User $user User object or null to use $wgUser * @return bool * @throws MWException */ diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index eb55e82095..f9b4f470d2 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -131,7 +131,7 @@ class LocalFile extends File { * * @param Title $title * @param FileRepo $repo - * @param $unused + * @param null $unused * * @return LocalFile */ @@ -207,6 +207,8 @@ class LocalFile extends File { /** * Constructor. * Do not call this except from inside a repo class. + * @param Title $title + * @param FileRepo $repo */ function __construct( $title, $repo ) { parent::__construct( $title, $repo ); @@ -322,7 +324,7 @@ class LocalFile extends File { } /** - * @param $prefix string + * @param string $prefix * @return array */ function getCacheFields( $prefix = 'img_' ) { @@ -455,8 +457,8 @@ class LocalFile extends File { /** * Decode a row from the database (either object or array) to an array * with timestamps and MIME types decoded, and the field prefix removed. - * @param $row - * @param $prefix string + * @param object $row + * @param string $prefix * @throws MWException * @return array */ @@ -482,6 +484,9 @@ class LocalFile extends File { /** * Load file metadata from a DB result row + * + * @param object $row + * @param string $prefix */ function loadFromRow( $row, $prefix = 'img_' ) { $this->dataLoaded = true; @@ -499,7 +504,7 @@ class LocalFile extends File { /** * Load file metadata from cache or DB, unless already loaded - * @param integer $flags + * @param int $flags */ function load( $flags = 0 ) { if ( !$this->dataLoaded ) { @@ -604,6 +609,8 @@ class LocalFile extends File { * * If 'mime' is given, it will be split into major_mime/minor_mime. * If major_mime/minor_mime are given, $this->mime will also be set. + * + * @param array $info */ function setProps( $info ) { $this->dataLoaded = true; @@ -791,6 +798,8 @@ class LocalFile extends File { * @todo Do we still care about this? Perhaps a maintenance script * can be made instead. Enabling this code results in a serious * RTT regression for wikis without 404 handling. + * + * @param string $thumbName */ function migrateThumbFile( $thumbName ) { /* Old code for bug 2532 @@ -1124,7 +1133,7 @@ class LocalFile extends File { * current time * @param User|null $user User object or null to use $wgUser * - * @return FileRepoStatus object. On success, the value member contains the + * @return FileRepoStatus On success, the value member contains the * archive name, or an empty string if it was a new file. */ function upload( $srcPath, $comment, $pageText, $flags = 0, $props = false, @@ -1684,7 +1693,7 @@ class LocalFile extends File { * * May throw database exceptions on error. * - * @param array $versions set of record ids of deleted items to restore, + * @param array $versions Set of record ids of deleted items to restore, * or empty to restore all revisions. * @param bool $unsuppress * @return FileRepoStatus @@ -2219,7 +2228,7 @@ class LocalFileDeleteBatch { /** * Removes non-existent files from a deletion batch. - * @param $batch array + * @param array $batch * @return array */ function removeNonexistentFiles( $batch ) { diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index b14a284d43..995cd7b481 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -66,7 +66,7 @@ abstract class UploadBase { const SESSION_STATUS_KEY = 'wsUploadStatusData'; /** - * @param $error int + * @param int $error * @return string */ public function getVerificationErrorCode( $error ) { @@ -111,7 +111,7 @@ abstract class UploadBase { * identifying the missing permission. * Can be overridden by subclasses. * - * @param $user User + * @param User $user * @return bool */ public static function isAllowed( $user ) { @@ -129,9 +129,9 @@ abstract class UploadBase { /** * Create a form of UploadBase depending on wpSourceType and initializes it * - * @param $request WebRequest - * @param $type - * @return null + * @param WebRequest $request + * @param string|null $type + * @return null|UploadBase */ public static function createFromRequest( &$request, $type = null ) { $type = $type ? $type : $request->getVal( 'wpSourceType', 'File' ); @@ -172,7 +172,7 @@ abstract class UploadBase { /** * Check whether a request if valid for this handler - * @param $request + * @param WebRequest $request * @return bool */ public static function isValidRequest( $request ) { @@ -193,9 +193,9 @@ abstract class UploadBase { /** * Initialize the path information - * @param string $name the desired destination name - * @param string $tempPath the temporary path - * @param int $fileSize the file size + * @param string $name The desired destination name + * @param string $tempPath The temporary path + * @param int $fileSize The file size * @param bool $removeTempFile (false) remove the temporary file? * @throws MWException */ @@ -211,6 +211,8 @@ abstract class UploadBase { /** * Initialize from a WebRequest. Override this in a subclass. + * + * @param WebRequest $request */ abstract public function initializeFromRequest( &$request ); @@ -232,7 +234,7 @@ abstract class UploadBase { /** * Return the file size - * @return integer + * @return int */ public function getFileSize() { return $this->mFileSize; @@ -247,8 +249,8 @@ abstract class UploadBase { } /** - * @param string $srcPath the source path - * @return string|bool the real path if it was a virtual URL Returns false on failure + * @param string $srcPath The source path + * @return string|bool The real path if it was a virtual URL Returns false on failure */ function getRealPath( $srcPath ) { wfProfileIn( __METHOD__ ); @@ -333,9 +335,9 @@ abstract class UploadBase { /** * Verify that the name is valid and, if necessary, that we can overwrite * - * @return mixed true if valid, otherwise and array with 'status' + * @return mixed True if valid, otherwise and array with 'status' * and other keys - **/ + */ public function validateName() { $nt = $this->getTitle(); if ( is_null( $nt ) ) { @@ -361,8 +363,8 @@ abstract class UploadBase { * * @note Only checks that it is not an evil mime. The does it have * correct extension given its mime type check is in verifyFile. - * @param string $mime representing the mime - * @return mixed true if the file is verified, an array otherwise + * @param string $mime Representing the mime + * @return mixed True if the file is verified, an array otherwise */ protected function verifyMimeType( $mime ) { global $wgVerifyMimeType; @@ -398,7 +400,7 @@ abstract class UploadBase { /** * Verifies that it's ok to include the uploaded file * - * @return mixed true of the file is verified, array otherwise. + * @return mixed True of the file is verified, array otherwise. */ protected function verifyFile() { global $wgVerifyMimeType; @@ -448,7 +450,7 @@ abstract class UploadBase { * Runs the blacklist checks, but not any checks that may * assume the entire file is present. * - * @return Mixed true for valid or array with error message key. + * @return mixed True for valid or array with error message key. */ protected function verifyPartialFile() { global $wgAllowJavaUploads, $wgDisableUploadScriptChecks; @@ -515,6 +517,8 @@ abstract class UploadBase { /** * Callback for ZipDirectoryReader to detect Java class files. + * + * @param array $entry */ function zipEntryCallback( $entry ) { $names = array( $entry['name'] ); @@ -539,9 +543,9 @@ abstract class UploadBase { /** * Alias for verifyTitlePermissions. The function was originally 'verifyPermissions' * but that suggests it's checking the user, when it's really checking the title + user combination. - * @param $user User object to verify the permissions against + * @param User $user User object to verify the permissions against * @return mixed An array as returned by getUserPermissionsErrors or true - * in case the user has proper permissions. + * in case the user has proper permissions. */ public function verifyPermissions( $user ) { return $this->verifyTitlePermissions( $user ); @@ -554,9 +558,9 @@ abstract class UploadBase { * isAllowed() should be called as well for generic is-user-blocked or * can-user-upload checking. * - * @param $user User object to verify the permissions against + * @param User $user object to verify the permissions against * @return mixed An array as returned by getUserPermissionsErrors or true - * in case the user has proper permissions. + * in case the user has proper permissions. */ public function verifyTitlePermissions( $user ) { /** @@ -593,7 +597,7 @@ abstract class UploadBase { * * This should not assume that mTempPath is set. * - * @return Array of warnings + * @return array Array of warnings */ public function checkWarnings() { global $wgLang; @@ -673,12 +677,12 @@ abstract class UploadBase { * Really perform the upload. Stores the file in the local repo, watches * if necessary and runs the UploadComplete hook. * - * @param $comment - * @param $pageText - * @param $watch - * @param $user User + * @param string $comment + * @param string $pageText + * @param bool $watch + * @param User $user * - * @return Status indicating the whether the upload succeeded. + * @return Status Indicating the whether the upload succeeded. */ public function performUpload( $comment, $pageText, $watch, $user ) { wfProfileIn( __METHOD__ ); @@ -842,8 +846,8 @@ abstract class UploadBase { * This method returns the file object, which also has a 'fileKey' property which can be passed through a form or * API request to find this stashed file again. * - * @param $user User - * @return UploadStashFile stashed file + * @param User $user + * @return UploadStashFile Stashed file */ public function stashFile( User $user = null ) { // was stashSessionFile @@ -860,7 +864,7 @@ abstract class UploadBase { /** * Stash a file in a temporary directory, returning a key which can be used to find the file again. See stashFile(). * - * @return String: file key + * @return string File key */ public function stashFileGetKey() { return $this->stashFile()->getFileKey(); @@ -869,7 +873,7 @@ abstract class UploadBase { /** * alias for stashFileGetKey, for backwards compatibility * - * @return String: file key + * @return string File key */ public function stashSession() { return $this->stashFileGetKey(); @@ -896,7 +900,7 @@ abstract class UploadBase { * earlier pseudo-'extensions' to determine type and execute * scripts, so the blacklist needs to check them all. * - * @param $filename string + * @param string $filename * @return array */ public static function splitExtensions( $filename ) { @@ -909,9 +913,9 @@ abstract class UploadBase { * Perform case-insensitive match against a list of file extensions. * Returns true if the extension is in the list. * - * @param $ext String - * @param $list Array - * @return Boolean + * @param string $ext + * @param array $list + * @return bool */ public static function checkFileExtension( $ext, $list ) { return in_array( strtolower( $ext ), $list ); @@ -921,9 +925,9 @@ abstract class UploadBase { * Perform case-insensitive match against a list of file extensions. * Returns an array of matching extensions. * - * @param $ext Array - * @param $list Array - * @return Boolean + * @param array $ext + * @param array $list + * @return bool */ public static function checkFileExtensionList( $ext, $list ) { return array_intersect( array_map( 'strtolower', $ext ), $list ); @@ -932,9 +936,9 @@ abstract class UploadBase { /** * Checks if the mime type of the uploaded file matches the file extension. * - * @param string $mime the mime type of the uploaded file - * @param string $extension the filename extension that the file is to be served with - * @return Boolean + * @param string $mime The mime type of the uploaded file + * @param string $extension The filename extension that the file is to be served with + * @return bool */ public static function verifyExtension( $mime, $extension ) { $magic = MimeMagic::singleton(); @@ -979,10 +983,10 @@ abstract class UploadBase { * potentially harmful. The present implementation will produce false * positives in some situations. * - * @param string $file pathname to the temporary upload file - * @param string $mime the mime type of the file - * @param string $extension the extension of the file - * @return Boolean: true if the file contains something looking like embedded scripts + * @param string $file Pathname to the temporary upload file + * @param string $mime The mime type of the file + * @param string $extension The extension of the file + * @return bool True if the file contains something looking like embedded scripts */ public static function detectScript( $file, $mime, $extension ) { global $wgAllowTitlesInSVG; @@ -1114,8 +1118,8 @@ abstract class UploadBase { * Check a whitelist of xml encodings that are known not to be interpreted differently * by the server's xml parser (expat) and some common browsers. * - * @param string $file pathname to the temporary upload file - * @return Boolean: true if the file contains an encoding that could be misinterpreted + * @param string $file Pathname to the temporary upload file + * @return bool True if the file contains an encoding that could be misinterpreted */ public static function checkXMLEncodingMissmatch( $file ) { global $wgSVGMetadataCutoff; @@ -1166,8 +1170,8 @@ abstract class UploadBase { } /** - * @param $filename string - * @return mixed false of the file is verified (does not contain scripts), array otherwise. + * @param string $filename + * @return mixed False of the file is verified (does not contain scripts), array otherwise. */ protected function detectScriptInSvg( $filename ) { $this->mSVGNSError = false; @@ -1191,8 +1195,8 @@ abstract class UploadBase { /** * Callback to filter SVG Processing Instructions. - * @param $target string processing instruction name - * @param $data string processing instruction attribute and value + * @param string $target processing instruction name + * @param string $data processing instruction attribute and value * @return bool (true if the filter identified something bad) */ public static function checkSvgPICallback( $target, $data ) { @@ -1205,8 +1209,8 @@ abstract class UploadBase { /** * @todo Replace this with a whitelist filter! - * @param $element string - * @param $attribs array + * @param string $element + * @param array $attribs * @return bool */ public function checkSvgScriptCallback( $element, $attribs ) { @@ -1357,8 +1361,8 @@ abstract class UploadBase { /** * Divide the element name passed by the xml parser to the callback into URI and prifix. - * @param $name string - * @return array containing the namespace URI and prefix + * @param string $name + * @return array Containing the namespace URI and prefix */ private static function splitXmlNamespace( $element ) { // 'http://www.w3.org/2000/svg:script' -> array( 'http://www.w3.org/2000/svg', 'script' ) @@ -1369,7 +1373,7 @@ abstract class UploadBase { } /** - * @param $name string + * @param string $name * @return string */ private function stripXmlNamespace( $name ) { @@ -1383,10 +1387,10 @@ abstract class UploadBase { * This relies on the $wgAntivirus and $wgAntivirusSetup variables. * $wgAntivirusRequired may be used to deny upload if the scan fails. * - * @param string $file pathname to the temporary upload file - * @return mixed false if not virus is found, NULL if the scan fails or is disabled, - * or a string containing feedback from the virus scanner if a virus was found. - * If textual feedback is missing but a virus was found, this function returns true. + * @param string $file Pathname to the temporary upload file + * @return mixed False if not virus is found, NULL if the scan fails or is disabled, + * or a string containing feedback from the virus scanner if a virus was found. + * If textual feedback is missing but a virus was found, this function returns true. */ public static function detectVirus( $file ) { global $wgAntivirus, $wgAntivirusSetup, $wgAntivirusRequired, $wgOut; @@ -1481,9 +1485,9 @@ abstract class UploadBase { * Check if there's an overwrite conflict and, if so, if restrictions * forbid this user from performing the upload. * - * @param $user User + * @param User $user * - * @return mixed true on success, array on failure + * @return mixed True on success, array on failure */ private function checkOverwrite( $user ) { // First check whether the local file can be overwritten @@ -1510,9 +1514,9 @@ abstract class UploadBase { /** * Check if a user is the last uploader * - * @param $user User object - * @param string $img image name - * @return Boolean + * @param User $user + * @param string $img Image name + * @return bool */ public static function userCanReUpload( User $user, $img ) { if ( $user->isAllowed( 'reupload' ) ) { @@ -1539,7 +1543,7 @@ abstract class UploadBase { * - File exists with normalized extension * - The file looks like a thumbnail and the original exists * - * @param $file File The File object to check + * @param File $file The File object to check * @return mixed False if the file does not exists, else an array */ public static function getExistsWarning( $file ) { @@ -1629,7 +1633,7 @@ abstract class UploadBase { /** * Helper function that checks whether the filename looks like a thumbnail - * @param $filename string + * @param string $filename * @return bool */ public static function isThumbName( $filename ) { @@ -1645,7 +1649,7 @@ abstract class UploadBase { /** * Get a list of blacklisted filename prefixes from [[MediaWiki:Filename-prefix-blacklist]] * - * @return array list of prefixes + * @return array List of prefixes */ public static function getFilenamePrefixBlacklist() { $blacklist = array(); @@ -1676,8 +1680,8 @@ abstract class UploadBase { * 'metadata' was requested. Oddly, we have to pass the "result" object down just so it can do that * with the appropriate format, presumably. * - * @param $result ApiResult: - * @return Array: image info + * @param ApiResult $result + * @return array Image info */ public function getImageInfo( $result ) { $file = $this->getLocalFile(); @@ -1694,7 +1698,7 @@ abstract class UploadBase { } /** - * @param $error array + * @param array $error * @return Status */ public function convertVerifyErrorToStatus( $error ) { @@ -1704,7 +1708,7 @@ abstract class UploadBase { } /** - * @param $forType null|string + * @param null|string $forType * @return int */ public static function getMaxUploadSize( $forType = null ) { @@ -1724,8 +1728,8 @@ abstract class UploadBase { /** * Get the current status of a chunked upload (used for polling). * The status will be read from the *current* user session. - * @param $statusKey string - * @return Array|bool + * @param string $statusKey + * @return array|bool */ public static function getSessionStatus( $statusKey ) { return isset( $_SESSION[self::SESSION_STATUS_KEY][$statusKey] ) @@ -1736,8 +1740,8 @@ abstract class UploadBase { /** * Set the current status of a chunked upload (used for polling). * The status will be stored in the *current* user session. - * @param $statusKey string - * @param $value array|false + * @param string $statusKey + * @param array|bool $value * @return void */ public static function setSessionStatus( $statusKey, $value ) { diff --git a/includes/upload/UploadFromChunks.php b/includes/upload/UploadFromChunks.php index bdcc9a1c45..d15ae43b36 100644 --- a/includes/upload/UploadFromChunks.php +++ b/includes/upload/UploadFromChunks.php @@ -36,9 +36,9 @@ class UploadFromChunks extends UploadFromFile { /** * Setup local pointers to stash, repo and user (similar to UploadFromStash) * - * @param $user User|null Default: null - * @param $stash UploadStash|bool Default: false - * @param $repo FileRepo|bool Default: false + * @param User|null $user Default: null + * @param UploadStash|bool $stash Default: false + * @param FileRepo|bool $repo Default: false */ public function __construct( $user = null, $stash = false, $repo = false ) { // user object. sometimes this won't exist, as when running from cron. @@ -67,6 +67,7 @@ class UploadFromChunks extends UploadFromFile { /** * Calls the parent stashFile and updates the uploadsession table to handle "chunks" * + * @param User|null $user * @return UploadStashFile stashed file */ public function stashFile( User $user = null ) { @@ -91,6 +92,10 @@ class UploadFromChunks extends UploadFromFile { /** * Continue chunk uploading + * + * @param string $name + * @param string $key + * @param WebRequestUpload $webRequestUpload */ public function continueChunks( $name, $key, $webRequestUpload ) { $this->mFileKey = $key; @@ -165,10 +170,10 @@ class UploadFromChunks extends UploadFromFile { /** * Perform the upload, then remove the temp copy afterward - * @param $comment string - * @param $pageText string - * @param $watch bool - * @param $user User + * @param string $comment + * @param string $pageText + * @param bool $watch + * @param User $user * @return Status */ public function performUpload( $comment, $pageText, $watch, $user ) { @@ -178,7 +183,7 @@ class UploadFromChunks extends UploadFromFile { /** * Returns the virtual chunk location: - * @param $index + * @param int $index * @return string */ function getVirtualChunkLocation( $index ) { @@ -283,7 +288,7 @@ class UploadFromChunks extends UploadFromFile { /** * Get the current Chunk index - * @return Integer index of the current chunk + * @return int Index of the current chunk */ private function getChunkIndex() { if ( $this->mChunkIndex !== null ) { @@ -294,7 +299,7 @@ class UploadFromChunks extends UploadFromFile { /** * Gets the current offset in fromt the stashedupload table - * @return Integer current byte offset of the chunk file set + * @return int Current byte offset of the chunk file set */ private function getOffset() { if ( $this->mOffset !== null ) { @@ -306,7 +311,7 @@ class UploadFromChunks extends UploadFromFile { /** * Output the chunk to disk * - * @param $chunkPath string + * @param string $chunkPath * @throws UploadChunkFileException * @return FileRepoStatus */ diff --git a/includes/upload/UploadFromFile.php b/includes/upload/UploadFromFile.php index a00ed327a6..5bc040cd68 100644 --- a/includes/upload/UploadFromFile.php +++ b/includes/upload/UploadFromFile.php @@ -35,7 +35,7 @@ class UploadFromFile extends UploadBase { protected $mUpload = null; /** - * @param $request WebRequest + * @param WebRequest $request */ function initializeFromRequest( &$request ) { $upload = $request->getUpload( 'wpUploadFile' ); @@ -49,8 +49,8 @@ class UploadFromFile extends UploadBase { /** * Initialize from a filename and a WebRequestUpload - * @param $name - * @param $webRequestUpload + * @param string $name + * @param WebRequestUpload $webRequestUpload */ function initialize( $name, $webRequestUpload ) { $this->mUpload = $webRequestUpload; @@ -59,7 +59,7 @@ class UploadFromFile extends UploadBase { } /** - * @param $request + * @param WebRequest $request * @return bool */ static function isValidRequest( $request ) { diff --git a/includes/upload/UploadFromUrl.php b/includes/upload/UploadFromUrl.php index 19b4dfde4c..9ebd7a9ba9 100644 --- a/includes/upload/UploadFromUrl.php +++ b/includes/upload/UploadFromUrl.php @@ -41,7 +41,7 @@ class UploadFromUrl extends UploadBase { * user is not allowed, return the name of the user right as a string. If * the user is allowed, have the parent do further permissions checking. * - * @param $user User + * @param User $user * * @return bool|string */ @@ -66,7 +66,7 @@ class UploadFromUrl extends UploadBase { * The domains in the whitelist can include wildcard characters (*) in place * of any of the domain levels, e.g. '*.flickr.com' or 'upload.*.gov.uk'. * - * @param $url string + * @param string $url * @return bool */ public static function isAllowedHost( $url ) { @@ -109,7 +109,7 @@ class UploadFromUrl extends UploadBase { /** * Checks whether the URL is not allowed. * - * @param $url string + * @param string $url * @return bool */ public static function isAllowedUrl( $url ) { @@ -124,9 +124,9 @@ class UploadFromUrl extends UploadBase { /** * Entry point for API upload * - * @param $name string - * @param $url string - * @param $async mixed Whether the download should be performed + * @param string $name + * @param string $url + * @param bool|string $async Whether the download should be performed * asynchronous. False for synchronous, async or async-leavemessage for * asynchronous download. * @throws MWException @@ -147,7 +147,7 @@ class UploadFromUrl extends UploadBase { /** * Entry point for SpecialUpload - * @param $request WebRequest object + * @param WebRequest $request */ public function initializeFromRequest( &$request ) { $desiredDestName = $request->getText( 'wpDestFile' ); @@ -162,7 +162,7 @@ class UploadFromUrl extends UploadBase { } /** - * @param $request WebRequest object + * @param WebRequest $request * @return bool */ public static function isValidRequest( $request ) { @@ -184,7 +184,7 @@ class UploadFromUrl extends UploadBase { /** * Download the file (if not async) * - * @param Array $httpOptions Array of options for MWHttpRequest. Ignored if async. + * @param array $httpOptions Array of options for MWHttpRequest. Ignored if async. * This could be used to override the timeout on the http request. * @return Status */ @@ -219,9 +219,9 @@ class UploadFromUrl extends UploadBase { /** * Callback: save a chunk of the result of a HTTP request to the temporary file * - * @param $req mixed - * @param $buffer string - * @return int number of bytes handled + * @param mixed $req + * @param string $buffer + * @return int Number of bytes handled */ public function saveTempFileChunk( $req, $buffer ) { $nbytes = fwrite( $this->mTmpHandle, $buffer ); @@ -241,7 +241,7 @@ class UploadFromUrl extends UploadBase { * Download the file, save it to the temporary file and update the file * size and set $mRemoveTempFile to true. * - * @param Array $httpOptions Array of options for MWHttpRequest + * @param array $httpOptions Array of options for MWHttpRequest * @return Status */ protected function reallyFetchFile( $httpOptions = array() ) { @@ -303,7 +303,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer checking warnings * until the file really has been fetched. - * @return Array + * @return array */ public function checkWarnings() { if ( $this->mAsync ) { @@ -316,7 +316,7 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer checking protection * until we are sure that the file can actually be uploaded - * @param $user User + * @param User $user * @return bool|mixed */ public function verifyTitlePermissions( $user ) { @@ -329,10 +329,10 @@ class UploadFromUrl extends UploadBase { /** * Wrapper around the parent function in order to defer uploading to the * job queue for asynchronous uploads - * @param $comment string - * @param $pageText string - * @param $watch bool - * @param $user User + * @param string $comment + * @param string $pageText + * @param bool $watch + * @param User $user * @return Status */ public function performUpload( $comment, $pageText, $watch, $user ) { @@ -346,11 +346,11 @@ class UploadFromUrl extends UploadBase { } /** - * @param $comment - * @param $pageText - * @param $watch - * @param $user User - * @return String + * @param string $comment + * @param string $pageText + * @param bool $watch + * @param User $user + * @return string */ protected function insertJob( $comment, $pageText, $watch, $user ) { $sessionKey = $this->stashSession(); diff --git a/includes/upload/UploadStash.php b/includes/upload/UploadStash.php index ad2196da7d..33cb0dbfaf 100644 --- a/includes/upload/UploadStash.php +++ b/includes/upload/UploadStash.php @@ -71,8 +71,8 @@ class UploadStash { * Designed to be compatible with the session stashing code in UploadBase * (should replace it eventually). * - * @param $repo FileRepo - * @param $user User (default null) + * @param FileRepo $repo + * @param User $user (default null) */ public function __construct( FileRepo $repo, $user = null ) { // this might change based on wiki's configuration. @@ -97,8 +97,8 @@ class UploadStash { * Get a file and its metadata from the stash. * The noAuth param is a bit janky but is required for automated scripts which clean out the stash. * - * @param string $key key under which file information is stored - * @param $noAuth Boolean (optional) Don't check authentication. Used by maintenance scripts. + * @param string $key Key under which file information is stored + * @param bool $noAuth (optional) Don't check authentication. Used by maintenance scripts. * @throws UploadStashFileNotFoundException * @throws UploadStashNotLoggedInException * @throws UploadStashWrongOwnerException @@ -156,7 +156,7 @@ class UploadStash { * Getter for file metadata. * * @param string $key key under which file information is stored - * @return Array + * @return array */ public function getMetadata( $key ) { $this->getFile( $key ); @@ -167,7 +167,7 @@ class UploadStash { * Getter for fileProps * * @param string $key key under which file information is stored - * @return Array + * @return array */ public function getFileProps( $key ) { $this->getFile( $key ); @@ -293,7 +293,7 @@ class UploadStash { * Does not clean up files in the repo, just the record of them. * * @throws UploadStashNotLoggedInException - * @return bool success + * @return bool Success */ public function clear() { if ( !$this->isLoggedIn ) { @@ -383,7 +383,7 @@ class UploadStash { * List all files in the stash. * * @throws UploadStashNotLoggedInException - * @return Array + * @return array */ public function listFiles() { if ( !$this->isLoggedIn ) { @@ -418,7 +418,7 @@ class UploadStash { * with an extension. * XXX this is somewhat redundant with the checks that ApiUpload.php does with incoming * uploads versus the desired filename. Maybe we can get that passed to us... - * @param $path + * @param string $path * @throws UploadStashFileException * @return string */ @@ -459,7 +459,7 @@ class UploadStash { * * @param string $key * @param int $readFromDB Constant (default: DB_SLAVE) - * @return boolean + * @return bool */ protected function fetchFileMetadata( $key, $readFromDB = DB_SLAVE ) { // populate $fileMetadata[$key] -- 2.20.1