From 3b2b6a277303d940c40eb162267e0b2cfcf6233b Mon Sep 17 00:00:00 2001 From: umherirrender Date: Thu, 14 Aug 2014 20:22:52 +0200 Subject: [PATCH] Add missing @param to function docs Change-Id: I47fa96a976f55a1a93cb75397285edb8c7f4cd8a --- includes/Category.php | 1 + includes/Feed.php | 1 + includes/ForkController.php | 1 + includes/FormOptions.php | 5 +++++ includes/Linker.php | 1 + includes/OutputPage.php | 2 ++ includes/actions/HistoryAction.php | 1 + includes/api/ApiUpload.php | 1 + includes/content/JSONContentHandler.php | 22 ++++++++++++++++++++-- includes/db/DatabaseMssql.php | 4 ++++ includes/db/DatabasePostgres.php | 3 +++ includes/deferred/SearchUpdate.php | 2 ++ includes/diff/DifferenceEngine.php | 3 +++ includes/exception/MWException.php | 1 + includes/filebackend/FileBackend.php | 2 +- includes/filerepo/FileRepo.php | 1 + includes/filerepo/RepoGroup.php | 1 + includes/filerepo/file/File.php | 1 + includes/filerepo/file/LocalFile.php | 6 ++++++ includes/gallery/ImageGalleryBase.php | 2 ++ includes/gallery/PackedImageGallery.php | 1 + includes/htmlform/HTMLEditTools.php | 4 ++++ includes/htmlform/HTMLHiddenField.php | 4 ++++ includes/htmlform/HTMLInfoField.php | 4 ++++ includes/objectcache/RedisBagOStuff.php | 1 + includes/objectcache/SqlBagOStuff.php | 1 + includes/parser/ParserOptions.php | 1 + includes/parser/ParserOutput.php | 1 + includes/profiler/ProfilerStandard.php | 2 ++ includes/specials/SpecialSearch.php | 2 ++ 30 files changed, 79 insertions(+), 3 deletions(-) diff --git a/includes/Category.php b/includes/Category.php index 7bab464bf7..322b0530b5 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -291,6 +291,7 @@ class Category { /** * Generic accessor + * @param string $key * @return bool */ private function getX( $key ) { diff --git a/includes/Feed.php b/includes/Feed.php index 58f3ebde72..60e623b47d 100644 --- a/includes/Feed.php +++ b/includes/Feed.php @@ -348,6 +348,7 @@ class RSSFeed extends ChannelFeed { class AtomFeed extends ChannelFeed { /** * @todo document + * @param string|int $ts * @return string */ function formatTime( $ts ) { diff --git a/includes/ForkController.php b/includes/ForkController.php index 05822302ef..c1765e24e4 100644 --- a/includes/ForkController.php +++ b/includes/ForkController.php @@ -160,6 +160,7 @@ class ForkController { /** * Fork a number of worker processes. * + * @param int $numProcs * @return string */ protected function forkWorkers( $numProcs ) { diff --git a/includes/FormOptions.php b/includes/FormOptions.php index 079267a246..c91c336762 100644 --- a/includes/FormOptions.php +++ b/includes/FormOptions.php @@ -375,6 +375,7 @@ class FormOptions implements ArrayAccess { /* @{ */ /** * Whether the option exists. + * @param string $name * @return bool */ public function offsetExists( $name ) { @@ -383,6 +384,7 @@ class FormOptions implements ArrayAccess { /** * Retrieve an option value. + * @param string $name * @return mixed */ public function offsetGet( $name ) { @@ -391,6 +393,8 @@ class FormOptions implements ArrayAccess { /** * Set an option to given value. + * @param string $name + * @param mixed $value */ public function offsetSet( $name, $value ) { $this->setValue( $name, $value ); @@ -398,6 +402,7 @@ class FormOptions implements ArrayAccess { /** * Delete the option. + * @param string $name */ public function offsetUnset( $name ) { $this->delete( $name ); diff --git a/includes/Linker.php b/includes/Linker.php index 9f578a925f..abc9404e90 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -702,6 +702,7 @@ class Linker { * frame parameters supplied by the Parser. * @param array $frameParams The frame parameters * @param string $query An optional query string to add to description page links + * @param Parser|null $parser * @return array */ private static function getImageLinkMTOParams( $frameParams, $query = '', $parser = null ) { diff --git a/includes/OutputPage.php b/includes/OutputPage.php index cb250361da..6ea495372d 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -311,6 +311,7 @@ class OutputPage extends ContextSource { * Constructor for OutputPage. This should not be called directly. * Instead a new RequestContext should be created and it will implicitly create * a OutputPage tied to that context. + * @param IContextSource|null $context */ function __construct( IContextSource $context = null ) { if ( $context === null ) { @@ -388,6 +389,7 @@ class OutputPage extends ContextSource { /** * Set the URL to be used for the . This should be used * in preference to addLink(), to avoid duplicate link tags. + * @param string $url */ function setCanonicalUrl( $url ) { $this->mCanonicalUrl = $url; diff --git a/includes/actions/HistoryAction.php b/includes/actions/HistoryAction.php index 63ba683938..7ca8f3a66a 100644 --- a/includes/actions/HistoryAction.php +++ b/includes/actions/HistoryAction.php @@ -874,6 +874,7 @@ class HistoryPager extends ReverseChronologicalPager { /** * This is called if a write operation is possible from the generated HTML + * @param bool $enable */ function preventClickjacking( $enable = true ) { $this->preventClickjacking = $enable; diff --git a/includes/api/ApiUpload.php b/includes/api/ApiUpload.php index 0222e67887..31816d6f59 100644 --- a/includes/api/ApiUpload.php +++ b/includes/api/ApiUpload.php @@ -466,6 +466,7 @@ class ApiUpload extends ApiBase { /** * Performs file verification, dies on error. + * @param array $verification */ protected function checkVerification( array $verification ) { // @todo Move them to ApiBase's message map diff --git a/includes/content/JSONContentHandler.php b/includes/content/JSONContentHandler.php index 9d001da1c8..6b7752781e 100644 --- a/includes/content/JSONContentHandler.php +++ b/includes/content/JSONContentHandler.php @@ -46,12 +46,30 @@ class JSONContentHandler extends TextContentHandler { return new $this->contentClass( '' ); } - /** JSON is English **/ + /** + * Returns the english language, because JSON is english, and should be handled as such. + * + * @param Title $title + * @param Content|null $content + * + * @return Language Return of wfGetLangObj( 'en' ) + * + * @see ContentHandler::getPageLanguage() + */ public function getPageLanguage( Title $title, Content $content = null ) { return wfGetLangObj( 'en' ); } - /** JSON is English **/ + /** + * Returns the english language, because JSON is english, and should be handled as such. + * + * @param Title $title + * @param Content|null $content + * + * @return Language Return of wfGetLangObj( 'en' ) + * + * @see ContentHandler::getPageLanguage() + */ public function getPageViewLanguage( Title $title, Content $content = null ) { return wfGetLangObj( 'en' ); } diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index c2f5b6dff6..3a4bb27058 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -340,6 +340,7 @@ class DatabaseMssql extends DatabaseBase { } /** + * @param array $err * @return string */ private function formatError( $err ) { @@ -1068,6 +1069,7 @@ class DatabaseMssql extends DatabaseBase { /** * Begin a transaction, committing any previously open transaction + * @param string $fname */ protected function doBegin( $fname = __METHOD__ ) { sqlsrv_begin_transaction( $this->mConn ); @@ -1076,6 +1078,7 @@ class DatabaseMssql extends DatabaseBase { /** * End a transaction + * @param string $fname */ protected function doCommit( $fname = __METHOD__ ) { sqlsrv_commit( $this->mConn ); @@ -1085,6 +1088,7 @@ class DatabaseMssql extends DatabaseBase { /** * Rollback a transaction. * No-op on non-transactional databases. + * @param string $fname */ protected function doRollback( $fname = __METHOD__ ) { sqlsrv_rollback( $this->mConn ); diff --git a/includes/db/DatabasePostgres.php b/includes/db/DatabasePostgres.php index 8642d1be72..45fb3f68d3 100644 --- a/includes/db/DatabasePostgres.php +++ b/includes/db/DatabasePostgres.php @@ -1201,6 +1201,9 @@ __INDEXATTR__; /** * Return aggregated value function call + * @param array $valuedata + * @param string $valuename + * @return array */ public function aggregateValue( $valuedata, $valuename = 'value' ) { return $valuedata; diff --git a/includes/deferred/SearchUpdate.php b/includes/deferred/SearchUpdate.php index 20f348a213..1466605ad4 100644 --- a/includes/deferred/SearchUpdate.php +++ b/includes/deferred/SearchUpdate.php @@ -115,6 +115,7 @@ class SearchUpdate implements DeferrableUpdate { * Clean text for indexing. Only really suitable for indexing in databases. * If you're using a real search engine, you'll probably want to override * this behavior and do something nicer with the original wikitext. + * @param string $text */ public static function updateText( $text ) { global $wgContLang; @@ -179,6 +180,7 @@ class SearchUpdate implements DeferrableUpdate { * Get a string representation of a title suitable for * including in a search index * + * @param SearchEngine $search * @return string A stripped-down title string ready for the search index */ private function indexTitle( SearchEngine $search ) { diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index 661330d0e7..ee918f3785 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -1140,6 +1140,8 @@ class DifferenceEngine extends ContextSource { /** * Use specified text instead of loading from the database + * @param Content $oldContent + * @param Content $newContent * @since 1.21 */ public function setContent( Content $oldContent, Content $newContent ) { @@ -1153,6 +1155,7 @@ class DifferenceEngine extends ContextSource { /** * Set the language in which the diff text is written * (Defaults to page content language). + * @param Language|string $lang * @since 1.19 */ public function setTextLanguage( $lang ) { diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 58b07f5af8..074128f889 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -252,6 +252,7 @@ class MWException extends Exception { /** * Send a header, if we haven't already sent them. We shouldn't, * but sometimes we might in a weird case like Export + * @param string $header */ private static function header( $header ) { if ( !headers_sent() ) { diff --git a/includes/filebackend/FileBackend.php b/includes/filebackend/FileBackend.php index 2820be26ad..78810eb3ef 100644 --- a/includes/filebackend/FileBackend.php +++ b/includes/filebackend/FileBackend.php @@ -218,7 +218,7 @@ abstract class FileBackend { /** * Check if the backend medium supports a field of extra features * - * @return int Bitfield of FileBackend::ATTR_* flags + * @param int $bitfield Bitfield of FileBackend::ATTR_* flags * @return bool * @since 1.23 */ diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index 3bff91fe55..25a06d270b 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -1448,6 +1448,7 @@ class FileRepo { * Delete files in the deleted directory if they are not referenced in the filearchive table * * STUB + * @param array $storageKeys */ public function cleanupDeletedBatch( array $storageKeys ) { $this->assertWritableRepo(); diff --git a/includes/filerepo/RepoGroup.php b/includes/filerepo/RepoGroup.php index 189c3a377d..0f80e16121 100644 --- a/includes/filerepo/RepoGroup.php +++ b/includes/filerepo/RepoGroup.php @@ -409,6 +409,7 @@ class RepoGroup { /** * Create a repo class based on an info structure + * @param array $info */ protected function newRepo( $info ) { $class = $info['class']; diff --git a/includes/filerepo/file/File.php b/includes/filerepo/file/File.php index 4e11c817ea..0c4e42e570 100644 --- a/includes/filerepo/file/File.php +++ b/includes/filerepo/file/File.php @@ -1287,6 +1287,7 @@ abstract class File { * Hook into transform() to allow migration of thumbnail files * STUB * Overridden by LocalFile + * @param string $thumbName */ function migrateThumbFile( $thumbName ) { } diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index 3ba47ff8e9..07f1f09e38 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -379,6 +379,7 @@ class LocalFile extends File { /** * Load file metadata from the DB + * @param int $flags */ function loadFromDB( $flags = 0 ) { # Polymorphic function name to distinguish foreign and local fetches @@ -931,6 +932,7 @@ class LocalFile extends File { /** * Delete cached transformed files for the current version only. + * @param array $options */ function purgeThumbnails( $options = array() ) { global $wgUseSquid; @@ -2371,6 +2373,7 @@ class LocalFileRestoreBatch { /** * Add a file by ID + * @param int $fa_id */ function addId( $fa_id ) { $this->ids[] = $fa_id; @@ -2378,6 +2381,7 @@ class LocalFileRestoreBatch { /** * Add a whole lot of files by ID + * @param int[] $ids */ function addIds( $ids ) { $this->ids = array_merge( $this->ids, $ids ); @@ -2973,6 +2977,7 @@ class LocalFileMoveBatch { /** * Cleanup a partially moved array of triplets by deleting the target * files. Called if something went wrong half way. + * @param array $triplets */ function cleanupTarget( $triplets ) { // Create dest pairs from the triplets @@ -2988,6 +2993,7 @@ class LocalFileMoveBatch { /** * Cleanup a fully moved array of triplets by deleting the source files. * Called at the end of the move process if everything else went ok. + * @param array $triplets */ function cleanupSource( $triplets ) { // Create source file names from the triplets diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index 53c2e10c5e..2d3ea5a1a6 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -123,6 +123,7 @@ abstract class ImageGalleryBase extends ContextSource { * * You should not call this directly, but instead use * ImageGalleryBase::factory(). + * @param string $mode */ function __construct( $mode = 'traditional' ) { global $wgGalleryOptions; @@ -154,6 +155,7 @@ abstract class ImageGalleryBase extends ContextSource { /** * Set bad image flag + * @param bool $flag */ function setHideBadImages( $flag = true ) { $this->mHideBadImages = $flag; diff --git a/includes/gallery/PackedImageGallery.php b/includes/gallery/PackedImageGallery.php index b004a9529e..207efa856e 100644 --- a/includes/gallery/PackedImageGallery.php +++ b/includes/gallery/PackedImageGallery.php @@ -103,6 +103,7 @@ class PackedImageGallery extends TraditionalImageGallery { /** * Do not support per-row on packed. It really doesn't work * since the images have varying widths. + * @param int $num */ public function setPerRow( $num ) { return; diff --git a/includes/htmlform/HTMLEditTools.php b/includes/htmlform/HTMLEditTools.php index 4f1b530224..77924ef24e 100644 --- a/includes/htmlform/HTMLEditTools.php +++ b/includes/htmlform/HTMLEditTools.php @@ -16,6 +16,8 @@ class HTMLEditTools extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getDiv( $value ) { @@ -25,6 +27,8 @@ class HTMLEditTools extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getRaw( $value ) { diff --git a/includes/htmlform/HTMLHiddenField.php b/includes/htmlform/HTMLHiddenField.php index 6ea95ed144..e32c0bb2ce 100644 --- a/includes/htmlform/HTMLHiddenField.php +++ b/includes/htmlform/HTMLHiddenField.php @@ -21,6 +21,8 @@ class HTMLHiddenField extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getDiv( $value ) { @@ -28,6 +30,8 @@ class HTMLHiddenField extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getRaw( $value ) { diff --git a/includes/htmlform/HTMLInfoField.php b/includes/htmlform/HTMLInfoField.php index cff82025be..a422047ac4 100644 --- a/includes/htmlform/HTMLInfoField.php +++ b/includes/htmlform/HTMLInfoField.php @@ -23,6 +23,8 @@ class HTMLInfoField extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getDiv( $value ) { @@ -34,6 +36,8 @@ class HTMLInfoField extends HTMLFormField { } /** + * @param string $value + * @return string * @since 1.20 */ public function getRaw( $value ) { diff --git a/includes/objectcache/RedisBagOStuff.php b/includes/objectcache/RedisBagOStuff.php index c7d2f13172..ae8cc5b70b 100644 --- a/includes/objectcache/RedisBagOStuff.php +++ b/includes/objectcache/RedisBagOStuff.php @@ -342,6 +342,7 @@ class RedisBagOStuff extends BagOStuff { /** * Get a Redis object with a connection suitable for fetching the specified key + * @param string $key * @return array (server, RedisConnRef) or (false, false) */ protected function getConnection( $key ) { diff --git a/includes/objectcache/SqlBagOStuff.php b/includes/objectcache/SqlBagOStuff.php index da3eda1635..58720790d3 100644 --- a/includes/objectcache/SqlBagOStuff.php +++ b/includes/objectcache/SqlBagOStuff.php @@ -521,6 +521,7 @@ class SqlBagOStuff extends BagOStuff { } /** + * @param DatabaseBase $db * @param string $exptime * @return bool */ diff --git a/includes/parser/ParserOptions.php b/includes/parser/ParserOptions.php index 64febcc528..2ca9d505bb 100644 --- a/includes/parser/ParserOptions.php +++ b/includes/parser/ParserOptions.php @@ -517,6 +517,7 @@ class ParserOptions { /** * Extra key that should be present in the parser cache key. + * @param string $key */ public function addExtraKey( $key ) { $this->mExtraKey .= '!' . $key; diff --git a/includes/parser/ParserOutput.php b/includes/parser/ParserOutput.php index 95c0a16a29..75fc01f0fe 100644 --- a/includes/parser/ParserOutput.php +++ b/includes/parser/ParserOutput.php @@ -502,6 +502,7 @@ class ParserOutput extends CacheTime { /** * Fairly generic flag setter thingy. + * @param string $flag */ public function setFlag( $flag ) { $this->mFlags[$flag] = true; diff --git a/includes/profiler/ProfilerStandard.php b/includes/profiler/ProfilerStandard.php index 7fd86eb1af..cc13416576 100644 --- a/includes/profiler/ProfilerStandard.php +++ b/includes/profiler/ProfilerStandard.php @@ -339,6 +339,7 @@ class ProfilerStandard extends Profiler { /** * Callback to get a formatted line for the call tree + * @param array $entry * @return string */ protected function getCallTreeLine( $entry ) { @@ -514,6 +515,7 @@ class ProfilerStandard extends Profiler { /** * Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead + * @param int $profileCount */ protected static function calculateOverhead( $profileCount ) { wfProfileIn( '-overhead-total' ); diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 5f1623927c..6419a575e4 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -1068,6 +1068,8 @@ class SpecialSearch extends SpecialPage { /** * @param string $term + * @param int $resultsShown + * @param int $totalNum * @return string */ protected function shortDialog( $term, $resultsShown, $totalNum ) { -- 2.20.1