From dd8921c9d97442c6e460acebee806c895f9b7d76 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 24 Jul 2014 19:43:25 +0200 Subject: [PATCH] Cleanup some docs (includes/[m-r]) - Swap "$variable type" to "type $variable" - Added missing types - Fixed spacing inside docs - Makes beginning of @param/@return/@var/@throws in capital - Changed some types to match the more common spelling Change-Id: I8ebfbcea0e2ae2670553822acedde49c1aa7e98d --- includes/media/BitmapMetadataHandler.php | 8 ++-- includes/media/DjVuImage.php | 24 ++++++------ includes/media/Exif.php | 8 ++-- includes/media/FormatMetadata.php | 12 +++--- includes/media/IPTC.php | 4 +- includes/media/Jpeg.php | 4 +- includes/media/JpegMetadataExtractor.php | 8 ++-- includes/media/MediaHandler.php | 10 ++--- includes/media/MediaTransformOutput.php | 4 +- includes/media/PNG.php | 2 +- includes/media/PNGMetadataExtractor.php | 2 +- includes/media/SVG.php | 2 +- includes/media/XCF.php | 2 +- includes/media/XMP.php | 10 ++--- includes/objectcache/BagOStuff.php | 8 ++-- includes/objectcache/WinCacheBagOStuff.php | 2 +- includes/page/Article.php | 6 +-- includes/page/ImagePage.php | 16 ++++---- includes/page/WikiPage.php | 38 +++++++++---------- includes/parser/DateFormatter.php | 2 +- includes/parser/LinkHolderArray.php | 2 +- includes/parser/Parser.php | 8 ++-- includes/parser/ParserCache.php | 2 +- includes/parser/ParserOptions.php | 2 +- includes/parser/ParserOutput.php | 6 +-- includes/parser/Preprocessor_Hash.php | 2 +- includes/poolcounter/PoolCounter.php | 4 +- includes/profiler/Profiler.php | 12 +++--- includes/profiler/ProfilerMwprof.php | 4 +- includes/profiler/ProfilerStandard.php | 2 +- includes/rcfeed/RCFeedEngine.php | 2 +- includes/resourceloader/ResourceLoader.php | 6 +-- .../ResourceLoaderFileModule.php | 4 +- .../ResourceLoaderLanguageNamesModule.php | 4 +- .../resourceloader/ResourceLoaderModule.php | 4 +- .../ResourceLoaderStartUpModule.php | 2 +- includes/revisiondelete/RevisionDeleter.php | 2 +- 37 files changed, 120 insertions(+), 120 deletions(-) diff --git a/includes/media/BitmapMetadataHandler.php b/includes/media/BitmapMetadataHandler.php index 2a393dbaa9..053c586432 100644 --- a/includes/media/BitmapMetadataHandler.php +++ b/includes/media/BitmapMetadataHandler.php @@ -97,7 +97,7 @@ class BitmapMetadataHandler { /** Add misc metadata. Warning: atm if the metadata category * doesn't have a priority, it will be silently discarded. * - * @param array $metaArray array of metadata values + * @param array $meta Array of metadata values * @param string $type Type. defaults to other. if two things have the same type they're merged */ function addMetadata( $metaArray, $type = 'other' ) { @@ -149,9 +149,9 @@ class BitmapMetadataHandler { /** Main entry point for jpeg's. * - * @param string $filename filename (with full path) + * @param string $filename Filename (with full path) * @return array Metadata result array. - * @throws MWException on invalid file. + * @throws MWException On invalid file. */ static function Jpeg( $filename ) { $showXMP = function_exists( 'xml_parser_create_ns' ); @@ -224,7 +224,7 @@ class BitmapMetadataHandler { * They don't really have native metadata, so just merges together * XMP and image comment. * - * @param string $filename full path to file + * @param string $filename Full path to file * @return array Metadata array */ public static function GIF( $filename ) { diff --git a/includes/media/DjVuImage.php b/includes/media/DjVuImage.php index 099375bfce..6ff19c9007 100644 --- a/includes/media/DjVuImage.php +++ b/includes/media/DjVuImage.php @@ -88,7 +88,7 @@ class DjVuImage { // something that explicitly initializes local variables. extract( unpack( 'a4magic/a4chunk/NchunkLength', $header ) ); /** @var string $chunk - * @var string $chunkLength */ + * @var string $chunkLength */ echo "$chunk $chunkLength\n"; $this->dumpForm( $file, $chunkLength, 1 ); fclose( $file ); @@ -107,7 +107,7 @@ class DjVuImage { // something that explicitly initializes local variables. extract( unpack( 'a4chunk/NchunkLength', $chunkHeader ) ); /** @var string $chunk - * @var string $chunkLength */ + * @var string $chunkLength */ echo str_repeat( ' ', $indent * 4 ) . "$chunk $chunkLength\n"; if ( $chunk == 'FORM' ) { @@ -143,9 +143,9 @@ class DjVuImage { extract( unpack( 'a4magic/a4form/NformLength/a4subtype', $header ) ); /** @var string $magic - * @var string $subtype - * @var string $formLength - * @var string $formType */ + * @var string $subtype + * @var string $formLength + * @var string $formType */ if ( $magic != 'AT&T' ) { wfDebug( __METHOD__ . ": not a DjVu file\n" ); } elseif ( $subtype == 'DJVU' ) { @@ -173,7 +173,7 @@ class DjVuImage { extract( unpack( 'a4chunk/Nlength', $header ) ); /** @var string $chunk - * @var string $length */ + * @var string $length */ return array( $chunk, $length ); } } @@ -249,12 +249,12 @@ class DjVuImage { # Newer files have rotation info in byte 10, but we don't use it yet. /** @var string $width - * @var string $height - * @var string $major - * @var string $minor - * @var string $resolution - * @var string $length - * @var string $gamma */ + * @var string $height + * @var string $major + * @var string $minor + * @var string $resolution + * @var string $length + * @var string $gamma */ return array( 'width' => $width, 'height' => $height, diff --git a/includes/media/Exif.php b/includes/media/Exif.php index d6301369ce..d285c0cda8 100644 --- a/includes/media/Exif.php +++ b/includes/media/Exif.php @@ -442,7 +442,7 @@ class Exif { * Do userComment tags and similar. See pg. 34 of exif standard. * basically first 8 bytes is charset, rest is value. * This has not been tested on any shift-JIS strings. - * @param string $prop prop name. + * @param string $prop Prop name */ private function charCodeString( $prop ) { if ( isset( $this->mFilteredExifData[$prop] ) ) { @@ -729,8 +729,8 @@ class Exif { /** * Validates if a tag has a legal value according to the Exif spec * - * @param string $section section where tag is located. - * @param string $tag the tag to check. + * @param string $section Section where tag is located. + * @param string $tag The tag to check. * @param mixed $val The value of the tag. * @param bool $recursive True if called recursively for array types. * @return bool @@ -840,7 +840,7 @@ class Exif { /** * Convenience function for debugging output * - * @param string $fname the name of the function calling this function + * @param string $fname The name of the function calling this function * @param bool $io Specify whether we're beginning or ending */ private function debugFile( $fname, $io ) { diff --git a/includes/media/FormatMetadata.php b/includes/media/FormatMetadata.php index 4200541c6f..4356953997 100644 --- a/includes/media/FormatMetadata.php +++ b/includes/media/FormatMetadata.php @@ -72,7 +72,7 @@ class FormatMetadata extends ContextSource { * * This is the usual entry point for this class. * - * @param array $tags the Exif data to format ( as returned by + * @param array $tags The Exif data to format ( as returned by * Exif::getFilteredData() or BitmapMetadataHandler ) * @param bool|IContextSource $context Context to use (optional) * @return array @@ -92,7 +92,7 @@ class FormatMetadata extends ContextSource { * value which most of the time are plain integers. This function * formats Exif (and other metadata) values into human readable form. * - * @param array $tags the Exif data to format ( as returned by + * @param array $tags The Exif data to format ( as returned by * Exif::getFilteredData() or BitmapMetadataHandler ) * @return array * @since 1.23 @@ -1006,7 +1006,7 @@ class FormatMetadata extends ContextSource { /** * Flatten an array, using the user language for any messages. * - * @param array $vals array of values + * @param array $vals Array of values * @param string $type Type of array (either lang, ul, ol). * lang = language assoc array with keys being the lang code * ul = unordered list, ol = ordered list @@ -1031,7 +1031,7 @@ class FormatMetadata extends ContextSource { * * This is public on the basis it might be useful outside of this class. * - * @param array $vals array of values + * @param array $vals Array of values * @param string $type Type of array (either lang, ul, ol). * lang = language assoc array with keys being the lang code * ul = unordered list, ol = ordered list @@ -1706,7 +1706,7 @@ class FormatMetadata extends ContextSource { * * @param File $file File to use * @param array $extendedMetadata - * @param int $maxCacheTime hook handlers might use this parameter to override cache time + * @param int $maxCacheTime Hook handlers might use this parameter to override cache time * * @return array [ => ['value' => ]], or [] on error * @since 1.23 @@ -1741,7 +1741,7 @@ class FormatMetadata extends ContextSource { * If the value is not a multilang array, it is returned unchanged. * See mediawiki.org/wiki/Manual:File_metadata_handling#Multi-language_array_format * @param mixed $value - * @return mixed value in best language, null if there were no languages at all + * @return mixed Value in best language, null if there were no languages at all * @since 1.23 */ protected function resolveMultilangValue( $value ) { diff --git a/includes/media/IPTC.php b/includes/media/IPTC.php index 503b968642..478249fe63 100644 --- a/includes/media/IPTC.php +++ b/includes/media/IPTC.php @@ -34,7 +34,7 @@ class IPTC { * * @see http://www.iptc.org/std/IIM/4.1/specification/IIMV4.1.pdf * - * @param string $rawData app13 block from jpeg containing iptc/iim data + * @param string $rawData The app13 block from jpeg containing iptc/iim data * @return array IPTC metadata array */ static function parse( $rawData ) { @@ -470,7 +470,7 @@ class IPTC { /** * take the value of 1:90 tag and returns a charset * @param string $tag 1:90 tag. - * @return string charset name or "?" + * @return string Charset name or "?" * Warning, this function does not (and is not intended to) detect * all iso 2022 escape codes. In practise, the code for utf-8 is the * only code that seems to have wide use. It does detect that code. diff --git a/includes/media/Jpeg.php b/includes/media/Jpeg.php index 918d4ae207..fbdbdfe31e 100644 --- a/includes/media/Jpeg.php +++ b/includes/media/Jpeg.php @@ -51,8 +51,8 @@ class JpegHandler extends ExifBitmapHandler { } /** Validate and normalize quality value to be between 1 and 100 (inclusive). - * @param int $value quality value, will be converted to integer or 0 if invalid - * @return bool true if the value is valid + * @param int $value Quality value, will be converted to integer or 0 if invalid + * @return bool True if the value is valid */ private static function validateQuality( $value ) { return $value === 'low'; diff --git a/includes/media/JpegMetadataExtractor.php b/includes/media/JpegMetadataExtractor.php index a0f85247a5..8c5b46bbd6 100644 --- a/includes/media/JpegMetadataExtractor.php +++ b/includes/media/JpegMetadataExtractor.php @@ -43,9 +43,9 @@ class JpegMetadataExtractor { * but gis doesn't support having multiple app1 segments * and those can't extract xmp on files containing both exif and xmp data * - * @param string $filename name of jpeg file - * @return array of interesting segments. - * @throws MWException if given invalid file. + * @param string $filename Name of jpeg file + * @return array Array of interesting segments. + * @throws MWException If given invalid file. */ static function segmentSplitter( $filename ) { $showXMP = function_exists( 'xml_parser_create_ns' ); @@ -193,7 +193,7 @@ class JpegMetadataExtractor { * * This should generally be called by BitmapMetadataHandler::doApp13() * - * @param string $app13 photoshop psir app13 block from jpg. + * @param string $app13 Photoshop psir app13 block from jpg. * @throws MWException (It gets caught next level up though) * @return string If the iptc hash is good or not. One of 'iptc-no-hash', * 'iptc-good-hash', 'iptc-bad-hash'. diff --git a/includes/media/MediaHandler.php b/includes/media/MediaHandler.php index 26126857d7..e8f83608b0 100644 --- a/includes/media/MediaHandler.php +++ b/includes/media/MediaHandler.php @@ -124,7 +124,7 @@ abstract class MediaHandler { * first page. * * @param File $image The image object, or false if there isn't one - * @param string $path the filename + * @param string $path The filename * @return array Follow the format of PHP getimagesize() internal function. * See http://www.php.net/getimagesize. MediaWiki will only ever use the * first two array keys (the width and height), and the 'bits' associative @@ -308,7 +308,7 @@ abstract class MediaHandler { * @param string $ext Extension of original file * @param string $mime MIME type of original file * @param array $params Handler specific rendering parameters - * @return array thumbnail extension and MIME type + * @return array Thumbnail extension and MIME type */ function getThumbType( $ext, $mime, $params = null ) { $magic = MimeMagic::singleton(); @@ -689,7 +689,7 @@ abstract class MediaHandler { * relevant errors. * * @param string $fileName The local path to the file. - * @return Status object + * @return Status */ function verifyUpload( $fileName ) { return Status::newGood(); @@ -843,8 +843,8 @@ abstract class MediaHandler { /** * Returns whether or not this handler supports the chained generation of thumbnails according * to buckets - * @return boolean - * @since 1.24 + * @return bool + * @since 1.24 */ public function supportsBucketing() { return false; diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index d8d56a4da9..bc9e9173de 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -32,7 +32,7 @@ abstract class MediaTransformOutput { */ public $responsiveUrls = array(); - /** @var File object */ + /** @var File */ protected $file; /** @var int Image width */ @@ -71,7 +71,7 @@ abstract class MediaTransformOutput { } /** - * @return File file + * @return File */ public function getFile() { return $this->file; diff --git a/includes/media/PNG.php b/includes/media/PNG.php index d879c129bd..7b3ddb5126 100644 --- a/includes/media/PNG.php +++ b/includes/media/PNG.php @@ -100,7 +100,7 @@ class PNGHandler extends BitmapHandler { /** * We do not support making APNG thumbnails, so always false * @param File $image - * @return bool false + * @return bool False */ function canAnimateThumbnail( $image ) { return false; diff --git a/includes/media/PNGMetadataExtractor.php b/includes/media/PNGMetadataExtractor.php index 30376f1e1b..bccd36c1e9 100644 --- a/includes/media/PNGMetadataExtractor.php +++ b/includes/media/PNGMetadataExtractor.php @@ -413,7 +413,7 @@ class PNGMetadataExtractor { * * @param resource $fh The file handle * @param int $size Size in bytes. - * @throws Exception if too big. + * @throws Exception If too big * @return string The chunk. */ private static function read( $fh, $size ) { diff --git a/includes/media/SVG.php b/includes/media/SVG.php index e28b38fab8..e890b29559 100644 --- a/includes/media/SVG.php +++ b/includes/media/SVG.php @@ -446,7 +446,7 @@ class SvgHandler extends ImageHandler { } /** - * @param array $params name=>value pairs of parameters + * @param array $params Name=>value pairs of parameters * @return string Filename to use */ function makeParamString( $params ) { diff --git a/includes/media/XCF.php b/includes/media/XCF.php index 9e6913763a..04099c3def 100644 --- a/includes/media/XCF.php +++ b/includes/media/XCF.php @@ -93,7 +93,7 @@ class XCFHandler extends BitmapHandler { * @author Hashar * * @param string $filename Full path to a XCF file - * @return bool|array metadata array just like PHP getimagesize() + * @return bool|array Metadata Array just like PHP getimagesize() */ static function getXCFMetaData( $filename ) { # Decode master structure diff --git a/includes/media/XMP.php b/includes/media/XMP.php index a74b701257..154c85dbc5 100644 --- a/includes/media/XMP.php +++ b/includes/media/XMP.php @@ -406,7 +406,7 @@ class XMPReader { * * @param XMLParser $parser XMLParser reference to the xml parser * @param string $data Character data - * @throws MWException on invalid data + * @throws MWException On invalid data */ function char( $parser, $data ) { @@ -726,7 +726,7 @@ class XMPReader { * this should always be * * @param string $elm Namespace . ' ' . tag - * @throws MWException if we have an element that's not + * @throws MWException If we have an element that's not */ private function startElementModeBag( $elm ) { if ( $elm === self::NS_RDF . ' Bag' ) { @@ -741,7 +741,7 @@ class XMPReader { * this should always be * * @param string $elm Namespace . ' ' . tag - * @throws MWException if we have an element that's not + * @throws MWException If we have an element that's not */ private function startElementModeSeq( $elm ) { if ( $elm === self::NS_RDF . ' Seq' ) { @@ -768,7 +768,7 @@ class XMPReader { * we don't care about. * * @param string $elm Namespace . ' ' . tag - * @throws MWException if we have an element that's not + * @throws MWException If we have an element that's not */ private function startElementModeLang( $elm ) { if ( $elm === self::NS_RDF . ' Alt' ) { @@ -963,7 +963,7 @@ class XMPReader { * * @param string $elm Namespace . ' ' . tagname * @param array $attribs Attributes. (needed for BAGSTRUCTS) - * @throws MWException if gets a tag other than + * @throws MWException If gets a tag other than */ private function startElementModeLi( $elm, $attribs ) { if ( ( $elm ) !== self::NS_RDF . ' li' ) { diff --git a/includes/objectcache/BagOStuff.php b/includes/objectcache/BagOStuff.php index de3efd14fa..6f8f9afd2d 100644 --- a/includes/objectcache/BagOStuff.php +++ b/includes/objectcache/BagOStuff.php @@ -251,7 +251,7 @@ abstract class BagOStuff { * Batch insertion * @param array $data $key => $value assoc array * @param int $exptime Either an interval in seconds or a unix timestamp for expiry - * @return bool success + * @return bool Success * @since 1.24 */ public function setMulti( array $data, $exptime = 0 ) { @@ -330,9 +330,9 @@ abstract class BagOStuff { * This will create the key with value $init and TTL $ttl if not present * * @param string $key - * @param integer $ttl - * @param integer $value - * @param integer $init + * @param int $ttl + * @param int $value + * @param int $init * @return bool * @since 1.24 */ diff --git a/includes/objectcache/WinCacheBagOStuff.php b/includes/objectcache/WinCacheBagOStuff.php index a6c7d9ca90..2a882ace83 100644 --- a/includes/objectcache/WinCacheBagOStuff.php +++ b/includes/objectcache/WinCacheBagOStuff.php @@ -52,7 +52,7 @@ class WinCacheBagOStuff extends BagOStuff { * Store a value in the WinCache object cache * * @param string $key Cache key - * @param mixed $valueObject to store + * @param mixed $valueObject Value to store * @param int $expire Expiration time * @return bool */ diff --git a/includes/page/Article.php b/includes/page/Article.php index 40a7d515bb..b789b7f609 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -1268,7 +1268,7 @@ class Article implements Page { * If the revision requested for view is deleted, check permissions. * Send either an error message or a warning header to the output. * - * @return bool true if the view is allowed, false if not. + * @return bool True if the view is allowed, false if not. */ public function showDeletedRevisionHeader() { if ( !$this->mRevision->isDeleted( Revision::DELETED_TEXT ) ) { @@ -1818,7 +1818,7 @@ class Article implements Page { * output to the client that is necessary for this request. * (that is, it has sent a cached version of the page) * - * @return bool true if cached version send, false otherwise + * @return bool True if cached version send, false otherwise */ protected function tryFileCache() { static $called = false; @@ -1894,7 +1894,7 @@ class Article implements Page { * Override the ParserOptions used to render the primary article wikitext. * * @param ParserOptions $options - * @throws MWException if the parser options where already initialized. + * @throws MWException If the parser options where already initialized. */ public function setParserOptions( ParserOptions $options ) { if ( $this->mParserOptions ) { diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index 9aff6ef27c..e50592ce63 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -1061,12 +1061,12 @@ EOT * of the dimensions are bigger than the max, or if the * image is vectorized. * - * @param $maxWidth integer Max width to display at - * @param $maxHeight integer Max height to display at - * @param $width integer Actual width of the image - * @param $height integer Actual height of the image + * @param int $maxWidth Max width to display at + * @param int $maxHeight Max height to display at + * @param int $width Actual width of the image + * @param int $height Actual height of the image * @throws MWException - * @return Array (width, height) + * @return array Array (width, height) */ protected function getDisplayWidthHeight( $maxWidth, $maxHeight, $width, $height ) { if ( !$maxWidth || !$maxHeight ) { @@ -1100,9 +1100,9 @@ EOT * Get alternative thumbnail sizes. * * @note This will only list several alternatives if thumbnails are rendered on 404 - * @param $origWidth Actual width of image - * @param $origHeight Actual height of image - * @return Array An array of [width, height] pairs. + * @param int $origWidth Actual width of image + * @param int $origHeight Actual height of image + * @return array An array of [width, height] pairs. */ protected function getThumbSizes( $origWidth, $origHeight ) { global $wgImageLimits; diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 8d0f0afb0b..be5ce3fc69 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -530,7 +530,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Loads page_touched and returns a value indicating if it should be used - * @return bool true if not a redirect + * @return bool True if not a redirect */ public function checkTouched() { if ( !$this->mDataLoaded ) { @@ -563,7 +563,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the page_latest field - * @return int rev_id of current revision + * @return int The rev_id of current revision */ public function getLatest() { if ( !$this->mDataLoaded ) { @@ -663,7 +663,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the content of the current revision. No side-effects... * - * @param int $audience int One of: + * @param int $audience One of: * Revision::FOR_PUBLIC to be displayed to all users * Revision::FOR_THIS_USER to be displayed to $wgUser * Revision::RAW get the text regardless of permissions @@ -743,7 +743,7 @@ class WikiPage implements Page, IDBAccessObject { * Revision::RAW get the text regardless of permissions * @param User $user User object to check for, only if FOR_THIS_USER is passed * to the $audience parameter - * @return int user ID for the user that made the last article revision + * @return int User ID for the user that made the last article revision */ public function getUser( $audience = Revision::FOR_PUBLIC, User $user = null ) { $this->loadLastEdit(); @@ -781,7 +781,7 @@ class WikiPage implements Page, IDBAccessObject { * Revision::RAW get the text regardless of permissions * @param User $user User object to check for, only if FOR_THIS_USER is passed * to the $audience parameter - * @return string username of the user that made the last article revision + * @return string Username of the user that made the last article revision */ public function getUserText( $audience = Revision::FOR_PUBLIC, User $user = null ) { $this->loadLastEdit(); @@ -968,7 +968,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Get the Title object or URL this page redirects to * - * @return bool|Title|string false, Title of in-wiki target, or string with URL + * @return bool|Title|string False, Title of in-wiki target, or string with URL */ public function followRedirect() { return $this->getRedirectURL( $this->getRedirectTarget() ); @@ -979,7 +979,7 @@ class WikiPage implements Page, IDBAccessObject { * objects for same-wiki, non-special redirects and URLs for everything * else. * @param Title $rt Redirect target - * @return bool|Title|string false, Title object of local target, or string with URL + * @return bool|Title|string False, Title object of local target, or string with URL */ public function getRedirectURL( $rt ) { if ( !$rt ) { @@ -1295,7 +1295,7 @@ class WikiPage implements Page, IDBAccessObject { * Giving 0 indicates the new page flag should be set on. * @param bool $lastRevIsRedirect If given, will optimize adding and * removing rows in redirect table. - * @return bool true on success, false on failure + * @return bool True on success, false on failure */ public function updateRevisionOn( $dbw, $revision, $lastRevision = null, $lastRevIsRedirect = null @@ -1357,7 +1357,7 @@ class WikiPage implements Page, IDBAccessObject { * or NULL if this is not a redirect * @param null|bool $lastRevIsRedirect If given, will optimize adding and * removing rows in redirect table. - * @return bool true on success, false on failure + * @return bool True on success, false on failure * @private */ public function updateRedirectOn( $dbw, $redirectTitle, $lastRevIsRedirect = null ) { @@ -1433,7 +1433,7 @@ class WikiPage implements Page, IDBAccessObject { * must exist and must not be deleted * @param Revision $undo * @param Revision $undoafter Must be an earlier revision than $undo - * @return mixed string on success, false on failure + * @return mixed String on success, false on failure * @since 1.21 * Before we had the Content object, this was done in getUndoText */ @@ -1448,7 +1448,7 @@ class WikiPage implements Page, IDBAccessObject { * must exist and must not be deleted * @param Revision $undo * @param Revision $undoafter Must be an earlier revision than $undo - * @return string|bool string on success, false on failure + * @return string|bool String on success, false on failure * @deprecated since 1.21: use ContentHandler::getUndoContent() instead. */ public function getUndoText( Revision $undo, Revision $undoafter = null ) { @@ -1563,7 +1563,7 @@ class WikiPage implements Page, IDBAccessObject { * or 'new' for a new section. * @param Content $sectionContent New content of the section. * @param string $sectionTitle New section's subject, only if $section is "new". - * @param string $baseRevId integer|null + * @param int|null $baseRevId * * @throws MWException * @return Content New complete article content, or null if error. @@ -1666,7 +1666,7 @@ class WikiPage implements Page, IDBAccessObject { * @param User $user The user doing the edit * * @throws MWException - * @return Status object. Possible errors: + * @return Status Possible errors: * edit-hook-aborted: The ArticleSave hook aborted the edit but didn't * set the fatal flag of $status * edit-gone-missing: In update mode, but the article didn't exist. @@ -1728,7 +1728,7 @@ class WikiPage implements Page, IDBAccessObject { * database. * * @throws MWException - * @return Status object. Possible errors: + * @return Status Possible errors: * edit-hook-aborted: The ArticleSave hook aborted the edit but didn't * set the fatal flag of $status. * edit-gone-missing: In update mode, but the article didn't exist. @@ -2313,7 +2313,7 @@ class WikiPage implements Page, IDBAccessObject { * * @param Content $content Content submitted * @param User $user The relevant user - * @param string $comment comment submitted + * @param string $comment Comment submitted * @param string $serialisation_format Format for storing the content in the database * @param bool $minor Whereas it's a minor modification */ @@ -2739,7 +2739,7 @@ class WikiPage implements Page, IDBAccessObject { * @param bool $commit Defaults to true, triggers transaction end * @param array &$error Array of errors to append to * @param User $user The deleting user - * @return bool true if successful + * @return bool True if successful */ public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error = '', User $user = null @@ -2904,7 +2904,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Do some database updates after deletion * - * @param int $id page_id value of the page being deleted + * @param int $id The page_id value of the page being deleted * @param Content $content Optional page content to be used when determining * the required updates. This may be needed because $this->getContent() * may already return null when the page proper was deleted. @@ -2949,7 +2949,7 @@ class WikiPage implements Page, IDBAccessObject { * @param string $token Rollback token. * @param bool $bot If true, mark all reverted edits as bot. * - * @param array $resultDetails contains result-specific array of additional values + * @param array $resultDetails Array contains result-specific array of additional values * 'alreadyrolled' : 'current' (rev) * success : 'summary' (str), 'current' (rev), 'target' (rev) * @@ -3525,7 +3525,7 @@ class WikiPage implements Page, IDBAccessObject { * @param int &$cascade Set to false if cascading protection isn't allowed. * @param array $expiry Per restriction type expiration * @param User $user The user updating the restrictions - * @return bool true on success + * @return bool True on success */ public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array(), User $user = null diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index cfd53702fa..0bf2ffcac8 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -122,7 +122,7 @@ class DateFormatter { * * @param Language|string|null $lang In which language to format the date * Defaults to the site content language - * @return DateFormatter object + * @return DateFormatter */ public static function &getInstance( $lang = null ) { global $wgMemc, $wgContLang; diff --git a/includes/parser/LinkHolderArray.php b/includes/parser/LinkHolderArray.php index 648667b06f..30bb2cffb0 100644 --- a/includes/parser/LinkHolderArray.php +++ b/includes/parser/LinkHolderArray.php @@ -265,7 +265,7 @@ class LinkHolderArray { /** * Replace link placeholders with actual links, in the buffer * - * @param $text + * @param string $text * @return array Array of link CSS classes, indexed by PDBK. */ function replace( &$text ) { diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index b37e977e82..bc4fcce282 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -211,7 +211,7 @@ class Parser { var $mLangLinkLanguages; /** - * @var boolean Recursive call protection. + * @var bool Recursive call protection. * This variable should be treated as if it were private. */ public $mInParse = false; @@ -349,7 +349,7 @@ class Parser { * Convert wikitext to HTML * Do not call this function recursively. * - * @param string $text text we want to parse + * @param string $text Text we want to parse * @param Title $title * @param ParserOptions $options * @param bool $linestart @@ -798,7 +798,7 @@ class Parser { /** * Get the ParserOptions object * - * @return ParserOptions object + * @return ParserOptions */ function getOptions() { return $this->mOptions; @@ -1434,7 +1434,7 @@ class Parser { * * @param string $text * - * @return string the altered text + * @return string The altered text */ function doAllQuotes( $text ) { wfProfileIn( __METHOD__ ); diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index 33f0f96836..6102ca481e 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -26,7 +26,7 @@ * @todo document */ class ParserCache { - /** @var MWMemcached */ + /** @var MWMemcached */ private $mMemc; /** * Get an instance of this object diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 2cd208c2d4..411702fe22 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -22,7 +22,7 @@ */ /** - * \brief Set options of the Parser + * @brief Set options of the Parser * * All member variables are supposed to be private in theory, although in * practise this is not the case. diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 1903fc4bbc..f6ad9316a3 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -396,7 +396,7 @@ class ParserOutput extends CacheTime { /** * @param Title $title Title object, must be an interwiki link - * @throws MWException if given invalid input + * @throws MWException If given invalid input */ function addInterwikiLink( $title ) { if ( !$title->isExternal() ) { @@ -478,7 +478,7 @@ class ParserOutput extends CacheTime { * -- this is assumed to have been validated * (check equal normalisation, etc.) * - * @param string $text desired title text + * @param string $text Desired title text */ public function setDisplayTitle( $text ) { $this->setTitleText( $text ); @@ -576,7 +576,7 @@ class ParserOutput extends CacheTime { /** * @param string $name The property name to look up. * - * @return mixed|false The value previously set using setProperty(). False if null or no value + * @return mixed|bool The value previously set using setProperty(). False if null or no value * was set for the given property name. * * @note You need to use getProperties() to check for boolean and null properties. diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index bf2bf614c3..26daca18ca 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -995,7 +995,7 @@ class PPFrame_Hash implements PPFrame { /** * @throws MWException - * @param string|PPNode$root + * @param string|PPNode $root * @param int $flags * @return string */ diff --git a/includes/poolcounter/PoolCounter.php b/includes/poolcounter/PoolCounter.php index f8d48cc707..e77ffd7cd6 100644 --- a/includes/poolcounter/PoolCounter.php +++ b/includes/poolcounter/PoolCounter.php @@ -132,7 +132,7 @@ abstract class PoolCounter { * Lets another one grab the lock, and returns the workers * waiting on acquireForAnyone() * - * @return Status value is one of Released/NotLocked/Error + * @return Status Value is one of Released/NotLocked/Error */ abstract public function release(); @@ -143,7 +143,7 @@ abstract class PoolCounter { * the same key can acquire a lock. * * @param string $key PoolCounter instance key (any string) - * @param int $slots the number of slots (max allowed value is 65536) + * @param int $slots The number of slots (max allowed value is 65536) * @return int */ protected function hashKeyIntoSlots( $key, $slots ) { diff --git a/includes/profiler/Profiler.php b/includes/profiler/Profiler.php index cd1e8595d2..7b8f340bab 100644 --- a/includes/profiler/Profiler.php +++ b/includes/profiler/Profiler.php @@ -25,7 +25,7 @@ /** * Begin profiling of a function - * @param string $functionname name of the function we will profile + * @param string $functionname Name of the function we will profile */ function wfProfileIn( $functionname ) { if ( Profiler::$__instance === null ) { // use this directly to reduce overhead @@ -38,7 +38,7 @@ function wfProfileIn( $functionname ) { /** * Stop profiling of a function - * @param string $functionname name of the function we have profiled + * @param string $functionname Name of the function we have profiled */ function wfProfileOut( $functionname = 'missing' ) { if ( Profiler::$__instance === null ) { // use this directly to reduce overhead @@ -196,7 +196,7 @@ abstract class Profiler { /** * Called by wfProfieOut() * - * @param string $functionname + * @param string $functionname */ abstract public function profileOut( $functionname ); @@ -326,7 +326,7 @@ abstract class Profiler { /** * Add an entry in the debug log file * - * @param string $s to output + * @param string $s String to output */ protected function debug( $s ) { if ( function_exists( 'wfDebug' ) ) { @@ -338,7 +338,7 @@ abstract class Profiler { * Add an entry in the debug log group * * @param string $group Group to send the message to - * @param string $s to output + * @param string $s String to output */ protected function debugGroup( $group, $s ) { if ( function_exists( 'wfDebugLog' ) ) { @@ -356,7 +356,7 @@ abstract class Profiler { * @since 1.24 */ class TransactionProfiler { - /** @var float seconds */ + /** @var float Seconds */ protected $mDBLockThreshold = 3.0; /** @var array DB/server name => (active trx count, time, DBs involved) */ protected $mDBTrxHoldingLocks = array(); diff --git a/includes/profiler/ProfilerMwprof.php b/includes/profiler/ProfilerMwprof.php index abcd23cfef..af3c7741c7 100644 --- a/includes/profiler/ProfilerMwprof.php +++ b/includes/profiler/ProfilerMwprof.php @@ -94,8 +94,8 @@ class ProfilerMwprof extends Profiler { * Update an entry with timing data. * * @param string $name Section name - * @param float $elapsedCpu elapsed CPU time - * @param float $elapsedWall elapsed wall-clock time + * @param float $elapsedCpu Elapsed CPU time + * @param float $elapsedWall Elapsed wall-clock time */ public function updateRunningEntry( $name, $elapsedCpu, $elapsedWall ) { // If this is the first measurement for this entry, store plain values. diff --git a/includes/profiler/ProfilerStandard.php b/includes/profiler/ProfilerStandard.php index 5de9982d3f..7fd86eb1af 100644 --- a/includes/profiler/ProfilerStandard.php +++ b/includes/profiler/ProfilerStandard.php @@ -299,7 +299,7 @@ class ProfilerStandard extends Profiler { /** * Recursive function the format the current profiling array into a tree * - * @param array $stack profiling array + * @param array $stack Profiling array * @return array */ protected function remapCallTree( array $stack ) { diff --git a/includes/rcfeed/RCFeedEngine.php b/includes/rcfeed/RCFeedEngine.php index 066ecbe775..768dd7f038 100644 --- a/includes/rcfeed/RCFeedEngine.php +++ b/includes/rcfeed/RCFeedEngine.php @@ -31,7 +31,7 @@ interface RCFeedEngine { * @see RecentChange::cleanupForIRC * @param array $feed The feed, as configured in an associative array * @param string $line The text to send - * @return bool success + * @return bool Success */ public function send( array $feed, $line ); } diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index 36e3a1b180..a89b45ff97 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -50,7 +50,7 @@ class ResourceLoader { */ protected $testModuleNames = array(); - /** @var array e.g. array( 'source-id' => array( 'loadScript' => 'http://.../load.php' ) ) */ + /** @var array E.g. array( 'source-id' => array( 'loadScript' => 'http://.../load.php' ) ) */ protected $sources = array(); /** @var bool */ @@ -463,7 +463,7 @@ class ResourceLoader { * * @since 1.24 * @param string $source - * @throws MWException on an invalid $source name + * @throws MWException On an invalid $source name * @return string */ public function getLoadScript( $source ) { @@ -1250,7 +1250,7 @@ class ResourceLoader { * Build a load.php URL * * @since 1.24 - * @param string $source name of the ResourceLoader source + * @param string $source Name of the ResourceLoader source * @param ResourceLoaderContext $context * @param array $extraQuery * @return string URL to load.php. May be protocol-relative (if $wgLoadScript is procol-relative) diff --git a/includes/resourceloader/ResourceLoaderFileModule.php b/includes/resourceloader/ResourceLoaderFileModule.php index 3a6d5d28dc..43bd562db8 100644 --- a/includes/resourceloader/ResourceLoaderFileModule.php +++ b/includes/resourceloader/ResourceLoaderFileModule.php @@ -331,7 +331,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { /** * Get loader script. * - * @return string|false JavaScript code to be added to startup module + * @return string|bool JavaScript code to be added to startup module */ public function getLoaderScript() { if ( count( $this->loaderScripts ) === 0 ) { @@ -804,7 +804,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule { * @param bool $flip * * @return string CSS data in script file - * @throws MWException if the file doesn't exist + * @throws MWException If the file doesn't exist */ protected function readStyleFile( $path, $flip ) { $localPath = $this->getLocalPath( $path ); diff --git a/includes/resourceloader/ResourceLoaderLanguageNamesModule.php b/includes/resourceloader/ResourceLoaderLanguageNamesModule.php index 73b6ea7da8..fe0c845436 100644 --- a/includes/resourceloader/ResourceLoaderLanguageNamesModule.php +++ b/includes/resourceloader/ResourceLoaderLanguageNamesModule.php @@ -34,7 +34,7 @@ class ResourceLoaderLanguageNamesModule extends ResourceLoaderModule { /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return array */ protected function getData( ResourceLoaderContext $context ) { @@ -45,7 +45,7 @@ class ResourceLoaderLanguageNamesModule extends ResourceLoaderModule { } /** - * @param $context ResourceLoaderContext + * @param ResourceLoaderContext $context * @return string JavaScript code */ public function getScript( ResourceLoaderContext $context ) { diff --git a/includes/resourceloader/ResourceLoaderModule.php b/includes/resourceloader/ResourceLoaderModule.php index 00d245c563..0ace76a871 100644 --- a/includes/resourceloader/ResourceLoaderModule.php +++ b/includes/resourceloader/ResourceLoaderModule.php @@ -188,7 +188,7 @@ abstract class ResourceLoaderModule { * load the files directly. See also getScriptURLsForDebug() * * @param ResourceLoaderContext $context - * @return array array( mediaType => array( URL1, URL2, ... ), ... ) + * @return array Array( mediaType => array( URL1, URL2, ... ), ... ) */ public function getStyleURLsForDebug( ResourceLoaderContext $context ) { $resourceLoader = $context->getResourceLoader(); @@ -548,7 +548,7 @@ abstract class ResourceLoaderModule { return false; } - /** @var JSParser lazy-initialized; use self::javaScriptParser() */ + /** @var JSParser Lazy-initialized; use self::javaScriptParser() */ private static $jsParser; private static $parseCacheVersion = 1; diff --git a/includes/resourceloader/ResourceLoaderStartUpModule.php b/includes/resourceloader/ResourceLoaderStartUpModule.php index 87782ec43c..2c0f8df785 100644 --- a/includes/resourceloader/ResourceLoaderStartUpModule.php +++ b/includes/resourceloader/ResourceLoaderStartUpModule.php @@ -168,7 +168,7 @@ class ResourceLoaderStartUpModule extends ResourceLoaderModule { * This way we can reasonably reduce the amout of module registration * data send to the client. * - * @param Array &$registryData Modules keyed by name with properties: + * @param array &$registryData Modules keyed by name with properties: * - string 'version' * - array 'dependencies' * - string|null 'group' diff --git a/includes/revisiondelete/RevisionDeleter.php b/includes/revisiondelete/RevisionDeleter.php index e42301b0a8..dc52969a16 100644 --- a/includes/revisiondelete/RevisionDeleter.php +++ b/includes/revisiondelete/RevisionDeleter.php @@ -91,7 +91,7 @@ class RevisionDeleter { * Checks for a change in the bitfield for a certain option and updates the * provided array accordingly. * - * @param string $desc description to add to the array if the option was + * @param string $desc Description to add to the array if the option was * enabled / disabled. * @param int $field The bitmask describing the single option. * @param int $diff The xor of the old and new bitfields. -- 2.20.1