From: umherirrender Date: Fri, 15 Aug 2014 16:22:34 +0000 (+0200) Subject: Add missing @param to function docs X-Git-Tag: 1.31.0-rc.0~14361^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_aide%28?a=commitdiff_plain;h=6b4c44c2db6aca8f843e7ea0b4f1b2b23d70aa33;p=lhc%2Fweb%2Fwiklou.git Add missing @param to function docs Change-Id: Ib26407bc55dff7969d8a3b1e2ae51751b202d8fb --- diff --git a/includes/Block.php b/includes/Block.php index 5881353a0c..88534c0b84 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -80,6 +80,20 @@ class Block { /** * @todo FIXME: Don't know what the best format to have for this constructor * is, but fourteen optional parameters certainly isn't it. + * @param string $address + * @param int $user + * @param int $by + * @param string $reason + * @param mixed $timestamp + * @param int $auto + * @param string $expiry + * @param int $anonOnly + * @param int $createAccount + * @param int $enableAutoblock + * @param int $hideName + * @param int $blockEmail + * @param int $allowUsertalk + * @param string $byText */ function __construct( $address = '', $user = 0, $by = 0, $reason = '', $timestamp = 0, $auto = 0, $expiry = '', $anonOnly = 0, $createAccount = 0, $enableAutoblock = 0, diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4c2b7725c6..805ba9e9c6 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -88,6 +88,7 @@ if ( !function_exists( 'mb_strrpos' ) ) { if ( !function_exists( 'gzdecode' ) ) { /** * @codeCoverageIgnore + * @param string $data * @return string */ function gzdecode( $data ) { diff --git a/includes/parser/Preprocessor.php b/includes/parser/Preprocessor.php index 77ffe9dc86..b32593c9f7 100644 --- a/includes/parser/Preprocessor.php +++ b/includes/parser/Preprocessor.php @@ -97,32 +97,54 @@ interface PPFrame { /** * Expand a document tree node, caching the result on its parent with the given key + * @param string|int $key + * @param string|PPNode $root + * @param int $flags + * @return string */ public function cachedExpand( $key, $root, $flags = 0 ); /** * Expand a document tree node + * @param string|PPNode $root + * @param int $flags + * @return string */ public function expand( $root, $flags = 0 ); /** * Implode with flags for expand() + * @param string $sep + * @param int $flags + * @param string|PPNode $args,... + * @return string */ public function implodeWithFlags( $sep, $flags /*, ... */ ); /** * Implode with no flags specified + * @param string $sep + * @param string|PPNode $args,... + * @return string */ public function implode( $sep /*, ... */ ); /** * Makes an object that, when expand()ed, will be the same as one obtained * with implode() + * @param string $sep + * @param string|PPNode $args,... + * @return PPNode */ public function virtualImplode( $sep /*, ... */ ); /** * Virtual implode with brackets + * @param string $start + * @param string $sep + * @param string $end + * @param string|PPNode $args,... + * @return PPNode */ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ); @@ -135,21 +157,26 @@ interface PPFrame { /** * Returns all arguments of this frame + * @return array */ public function getArguments(); /** * Returns all numbered arguments of this frame + * @return array */ public function getNumberedArguments(); /** * Returns all named arguments of this frame + * @return array */ public function getNamedArguments(); /** * Get an argument to this frame by name + * @param string $name + * @return bool */ public function getArgument( $name ); @@ -163,6 +190,7 @@ interface PPFrame { /** * Return true if the frame is a template frame + * @return bool */ public function isTemplate(); @@ -240,6 +268,7 @@ interface PPNode { /** * Get an array-type node containing the children of this node. * Returns false if this is not a tree node. + * @return PPNode */ public function getChildren(); @@ -252,12 +281,15 @@ interface PPNode { /** * Get the next sibling of any node. False if there isn't one + * @return PPNode */ public function getNextSibling(); /** * Get all children of this tree node which have a given name. * Returns an array-type node, or false if this is not a tree node. + * @param string $type + * @return bool|PPNode */ public function getChildrenOfType( $type ); @@ -268,6 +300,8 @@ interface PPNode { /** * Returns an item of an array-type node + * @param int $i + * @return bool|PPNode */ public function item( $i ); @@ -282,6 +316,7 @@ interface PPNode { * #nodelist An array-type node * * The subclass may define various other names for tree and leaf nodes. + * @return string */ public function getName(); @@ -290,17 +325,20 @@ interface PPNode { * name PPNode name * index String index * value PPNode value + * @return array */ public function splitArg(); /** * Split an "" node into an associative array containing name, attr, inner and close * All values in the resulting array are PPNodes. Inner and close are optional. + * @return array */ public function splitExt(); /** * Split an "" node + * @return array */ public function splitHeading(); } diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index 6136555a46..8416ac3c7b 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -1315,6 +1315,7 @@ class PPFrame_DOM implements PPFrame { /** * @param string $sep * @param int $flags + * @param string|PPNode_DOM|DOMDocument $args,... * @return string */ public function implodeWithFlags( $sep, $flags /*, ... */ ) { @@ -1346,6 +1347,7 @@ class PPFrame_DOM implements PPFrame { * This previously called implodeWithFlags but has now been inlined to reduce stack depth * * @param string $sep + * @param string|PPNode_DOM|DOMDocument $args,... * @return string */ public function implode( $sep /*, ... */ ) { @@ -1377,6 +1379,7 @@ class PPFrame_DOM implements PPFrame { * with implode() * * @param string $sep + * @param string|PPNode_DOM|DOMDocument $args,... * @return array */ public function virtualImplode( $sep /*, ... */ ) { @@ -1408,6 +1411,7 @@ class PPFrame_DOM implements PPFrame { * @param string $start * @param string $sep * @param string $end + * @param string|PPNode_DOM|DOMDocument $args,... * @return array */ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) { diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index f75183291d..e1d73283f9 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -1224,6 +1224,7 @@ class PPFrame_Hash implements PPFrame { /** * @param string $sep * @param int $flags + * @param string|PPNode $args,... * @return string */ public function implodeWithFlags( $sep, $flags /*, ... */ ) { @@ -1254,6 +1255,7 @@ class PPFrame_Hash implements PPFrame { * Implode with no flags specified * This previously called implodeWithFlags but has now been inlined to reduce stack depth * @param string $sep + * @param string|PPNode $args,... * @return string */ public function implode( $sep /*, ... */ ) { @@ -1285,6 +1287,7 @@ class PPFrame_Hash implements PPFrame { * with implode() * * @param string $sep + * @param string|PPNode $args,... * @return PPNode_Hash_Array */ public function virtualImplode( $sep /*, ... */ ) { @@ -1317,6 +1320,7 @@ class PPFrame_Hash implements PPFrame { * @param string $start * @param string $sep * @param string $end + * @param string|PPNode $args,... * @return PPNode_Hash_Array */ public function virtualBracketedImplode( $start, $sep, $end /*, ... */ ) { diff --git a/includes/utils/MWCryptHKDF.php b/includes/utils/MWCryptHKDF.php index 6c532497bd..cc136793c9 100644 --- a/includes/utils/MWCryptHKDF.php +++ b/includes/utils/MWCryptHKDF.php @@ -99,7 +99,8 @@ class MWCryptHKDF { /** - * @param string $hash Name of hashing algorithm + * @param string $secretKeyMaterial + * @param string $algorithm Name of hashing algorithm * @param BagOStuff $cache * @param string|array $context Context to mix into HKDF context */ diff --git a/includes/utils/ZipDirectoryReader.php b/includes/utils/ZipDirectoryReader.php index 0f56e33751..bc849766ed 100644 --- a/includes/utils/ZipDirectoryReader.php +++ b/includes/utils/ZipDirectoryReader.php @@ -129,6 +129,9 @@ class ZipDirectoryReader { /** * Private constructor + * @param string $fileName + * @param callable $callback + * @param array $options */ protected function __construct( $fileName, $callback, $options ) { $this->fileName = $fileName; @@ -359,6 +362,8 @@ class ZipDirectoryReader { /** * Read the central directory at the given location + * @param int $offset + * @param int $size */ function readCentralDirectory( $offset, $size ) { $block = $this->getBlock( $offset, $size ); @@ -450,6 +455,7 @@ class ZipDirectoryReader { /** * Interpret ZIP64 "extra field" data and return an associative array. + * @param string $extraField * @return array|bool */ function unpackZip64Extra( $extraField ) { @@ -575,6 +581,7 @@ class ZipDirectoryReader { /** * Get the size of a structure in bytes. See unpack() for the format of $struct. + * @param array $struct * @return int */ function getStructSize( $struct ) { diff --git a/languages/Language.php b/languages/Language.php index cd8df5d480..537e236456 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1026,6 +1026,11 @@ class Language { /** * Pass through result from $dateTimeObj->format() + * @param DateTime &$dateTimeObj + * @param string $ts + * @param DateTimeZone $zone + * @param string $code + * @return string */ private static function dateTimeObjFormat( &$dateTimeObj, $ts, $zone, $code ) { if ( !$dateTimeObj ) { diff --git a/maintenance/archives/upgradeLogging.php b/maintenance/archives/upgradeLogging.php index 9ac204d2c0..aeadc93d4d 100644 --- a/maintenance/archives/upgradeLogging.php +++ b/maintenance/archives/upgradeLogging.php @@ -125,6 +125,8 @@ EOT; /** * Copy all rows from $srcTable to $dstTable + * @param string $srcTable + * @param string $dstTable */ function sync( $srcTable, $dstTable ) { $batchSize = 1000; diff --git a/maintenance/backupTextPass.inc b/maintenance/backupTextPass.inc index 7fca377335..5f7763730e 100644 --- a/maintenance/backupTextPass.inc +++ b/maintenance/backupTextPass.inc @@ -343,6 +343,7 @@ class TextPassDumper extends BackupDumper { /** * @throws MWException Failure to parse XML input + * @param string $input * @return bool */ function readDump( $input ) { diff --git a/maintenance/commandLine.inc b/maintenance/commandLine.inc index 0d3e643234..88776f4f41 100644 --- a/maintenance/commandLine.inc +++ b/maintenance/commandLine.inc @@ -43,6 +43,7 @@ class CommandLineInc extends Maintenance { /** * No help, it would just be misleading since it misses custom options + * @param bool $force */ protected function maybeHelp( $force = false ) { if ( !$force ) { diff --git a/maintenance/deleteEqualMessages.php b/maintenance/deleteEqualMessages.php index 3d30b830dd..bd99845687 100644 --- a/maintenance/deleteEqualMessages.php +++ b/maintenance/deleteEqualMessages.php @@ -41,6 +41,7 @@ class DeleteEqualMessages extends Maintenance { /** * @param string|bool $langCode See --lang-code option. + * @param array &$messageInfo */ protected function fetchMessageInfo( $langCode, array &$messageInfo ) { global $wgContLang; diff --git a/maintenance/findHooks.php b/maintenance/findHooks.php index 074388f68d..d40fec6fd7 100644 --- a/maintenance/findHooks.php +++ b/maintenance/findHooks.php @@ -136,6 +136,7 @@ class FindHooks extends Maintenance { /** * Get the hook documentation, either locally or from MediaWiki.org + * @param string $doc * @return Array of documented hooks */ private function getHooksFromDoc( $doc ) { diff --git a/maintenance/purgeChangedPages.php b/maintenance/purgeChangedPages.php index 4ce9474ffd..6702209431 100644 --- a/maintenance/purgeChangedPages.php +++ b/maintenance/purgeChangedPages.php @@ -164,6 +164,7 @@ class PurgeChangedPages extends Maintenance { * * @param ResultWrapper $res Query result sorted by $column (ascending) * @param string $column + * @param int $limit * @return array (array of rows, string column value) */ protected function pageableSortedRows( ResultWrapper $res, $column, $limit ) { diff --git a/maintenance/purgeOldText.inc b/maintenance/purgeOldText.inc index 913e9f0cba..5093cb391b 100644 --- a/maintenance/purgeOldText.inc +++ b/maintenance/purgeOldText.inc @@ -23,6 +23,9 @@ * @author Rob Church */ +/** + * @param bool $delete + */ function PurgeRedundantText( $delete = false ) { # Data should come off the master, wrapped in a transaction diff --git a/maintenance/storage/compressOld.php b/maintenance/storage/compressOld.php index 0f337ec046..cfffbbcae9 100644 --- a/maintenance/storage/compressOld.php +++ b/maintenance/storage/compressOld.php @@ -136,7 +136,11 @@ class CompressOld extends Maintenance { } } - /** @todo document */ + /** + * @todo document + * @param int $start + * @param string $extdb + */ private function compressOldPages( $start = 0, $extdb = '' ) { $chunksize = 50; $this->output( "Starting from old_id $start...\n" ); diff --git a/maintenance/storage/recompressTracked.php b/maintenance/storage/recompressTracked.php index 307d0b0d4b..910f56bd80 100644 --- a/maintenance/storage/recompressTracked.php +++ b/maintenance/storage/recompressTracked.php @@ -289,6 +289,8 @@ class RecompressTracked { /** * Dispatch a command to a specified slave + * @param int $slaveId + * @param array|string $args */ function dispatchToSlave( $slaveId, $args ) { $args = (array)$args; @@ -352,6 +354,9 @@ class RecompressTracked { /** * Display a progress report + * @param string $label + * @param int $current + * @param int $end */ function report( $label, $current, $end ) { $this->numBatches++; @@ -707,6 +712,8 @@ class CgzCopyTransaction { /** * Create a transaction from a RecompressTracked object + * @param RecompressTracked $parent + * @param string $blobClass */ function __construct( $parent, $blobClass ) { $this->blobClass = $blobClass; diff --git a/maintenance/storage/resolveStubs.php b/maintenance/storage/resolveStubs.php index dff5cb8638..290f1649de 100644 --- a/maintenance/storage/resolveStubs.php +++ b/maintenance/storage/resolveStubs.php @@ -65,6 +65,9 @@ function resolveStubs() { /** * Resolve a history stub + * @param int $id + * @param string $stubText + * @param string $flags */ function resolveStub( $id, $stubText, $flags ) { $fname = 'resolveStub'; diff --git a/maintenance/syncFileBackend.php b/maintenance/syncFileBackend.php index b9493cdc0b..14a1502f8a 100644 --- a/maintenance/syncFileBackend.php +++ b/maintenance/syncFileBackend.php @@ -280,6 +280,7 @@ class SyncFileBackend extends Maintenance { * Substitute the backend name of storage paths with that of a given one * * @param array|string $paths List of paths or single string path + * @param FileBackend $backend * @return array|string */ protected function replaceNamePaths( $paths, FileBackend $backend ) { diff --git a/maintenance/updateCollation.php b/maintenance/updateCollation.php index 19c1d24c79..5bee7f9622 100644 --- a/maintenance/updateCollation.php +++ b/maintenance/updateCollation.php @@ -219,6 +219,8 @@ TEXT; /** * Return an SQL expression selecting rows which sort above the given row, * assuming an ordering of cl_to, cl_type, cl_from + * @param stdClass $row + * @param DatabaseBase $dbw */ function getBatchCondition( $row, $dbw ) { $fields = array( 'cl_to', 'cl_type', 'cl_from' ); diff --git a/maintenance/userOptions.inc b/maintenance/userOptions.inc index 9b8714d188..99ba3b8329 100644 --- a/maintenance/userOptions.inc +++ b/maintenance/userOptions.inc @@ -40,7 +40,11 @@ class UserOptions { private $mMode, $mReady; - /** Constructor. Will show usage and exit if script options are not correct */ + /** + * Constructor. Will show usage and exit if script options are not correct + * @param array $opts + * @param array $args + */ function __construct( $opts, $args ) { if ( !$this->checkOpts( $opts, $args ) ) { UserOptions::showUsageAndExit(); diff --git a/tests/phpunit/includes/ImportTest.php b/tests/phpunit/includes/ImportTest.php index f82a756f45..2fce6bfb87 100644 --- a/tests/phpunit/includes/ImportTest.php +++ b/tests/phpunit/includes/ImportTest.php @@ -22,6 +22,7 @@ class ImportTest extends MediaWikiLangTestCase { * @covers WikiImporter::handlePage * @dataProvider getRedirectXML * @param string $xml + * @param string|null $redirectTitle */ public function testHandlePageContainsRedirect( $xml, $redirectTitle ) { $source = $this->getInputStreamSource( $xml ); diff --git a/tests/phpunit/includes/api/query/ApiQueryTestBase.php b/tests/phpunit/includes/api/query/ApiQueryTestBase.php index f920ce9ce7..56c15b2387 100644 --- a/tests/phpunit/includes/api/query/ApiQueryTestBase.php +++ b/tests/phpunit/includes/api/query/ApiQueryTestBase.php @@ -52,6 +52,8 @@ STR; /** * Check that the parameter is a valid two element array, * with the first element being API request and the second - expected result + * @param array $v + * @return array */ private function validateRequestExpectedPair( $v ) { $this->assertType( 'array', $v, self::PARAM_ASSERT ); @@ -66,6 +68,8 @@ STR; /** * Recursively merges the expected values in the $item into the $all + * @param array &$all + * @param array $item */ private function mergeExpected( &$all, $item ) { foreach ( $item as $k => $v ) { diff --git a/tests/phpunit/includes/specials/SpecialSearchTest.php b/tests/phpunit/includes/specials/SpecialSearchTest.php index 1f1d75071f..3be9f2c4c0 100644 --- a/tests/phpunit/includes/specials/SpecialSearchTest.php +++ b/tests/phpunit/includes/specials/SpecialSearchTest.php @@ -18,7 +18,8 @@ class SpecialSearchTest extends MediaWikiTestCase { * @param array $userOptions User options to test with. For example: * array('searchNs5' => 1 );. Null to use default options. * @param string $expectedProfile An expected search profile name - * @param array $expectedNs Expected namespaces + * @param array $expectedNS Expected namespaces + * @param string $message */ public function testProfileAndNamespaceLoading( $requested, $userOptions, $expectedProfile, $expectedNS, $message = 'Profile name and namespaces mismatches!' @@ -96,6 +97,7 @@ class SpecialSearchTest extends MediaWikiTestCase { /** * Helper to create a new User object with given options * User remains anonymous though + * @param array|null $opt */ function newUserWithSearchNS( $opt = null ) { $u = User::newFromId( 0 ); diff --git a/tests/phpunit/mocks/media/MockImageHandler.php b/tests/phpunit/mocks/media/MockImageHandler.php index b2f7facf10..e0a72fd611 100644 --- a/tests/phpunit/mocks/media/MockImageHandler.php +++ b/tests/phpunit/mocks/media/MockImageHandler.php @@ -35,6 +35,13 @@ class MockImageHandler { * a thumbnail at all. That is merely returning a ThumbnailImage that * will be consumed by the unit test. There is no need to create a real * thumbnail on the filesystem. + * @param ImageHandler $that + * @param File $image + * @param string $dstPath + * @param string $dstUrl + * @param array $params + * @param int $flags + * @return ThumbnailImage */ static function doFakeTransform( $that, $image, $dstPath, $dstUrl, $params, $flags = 0 ) { # Example of what we receive: