Add missing @param to function docs
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 15 Aug 2014 16:22:34 +0000 (18:22 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 18 Aug 2014 16:24:59 +0000 (16:24 +0000)
Change-Id: Ib26407bc55dff7969d8a3b1e2ae51751b202d8fb

25 files changed:
includes/Block.php
includes/GlobalFunctions.php
includes/parser/Preprocessor.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/utils/MWCryptHKDF.php
includes/utils/ZipDirectoryReader.php
languages/Language.php
maintenance/archives/upgradeLogging.php
maintenance/backupTextPass.inc
maintenance/commandLine.inc
maintenance/deleteEqualMessages.php
maintenance/findHooks.php
maintenance/purgeChangedPages.php
maintenance/purgeOldText.inc
maintenance/storage/compressOld.php
maintenance/storage/recompressTracked.php
maintenance/storage/resolveStubs.php
maintenance/syncFileBackend.php
maintenance/updateCollation.php
maintenance/userOptions.inc
tests/phpunit/includes/ImportTest.php
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/specials/SpecialSearchTest.php
tests/phpunit/mocks/media/MockImageHandler.php

index 5881353..88534c0 100644 (file)
@@ -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,
index 4c2b772..805ba9e 100644 (file)
@@ -88,6 +88,7 @@ if ( !function_exists( 'mb_strrpos' ) ) {
 if ( !function_exists( 'gzdecode' ) ) {
        /**
         * @codeCoverageIgnore
+        * @param string $data
         * @return string
         */
        function gzdecode( $data ) {
index 77ffe9d..b32593c 100644 (file)
@@ -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 "<ext>" 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 "<h>" node
+        * @return array
         */
        public function splitHeading();
 }
index 6136555..8416ac3 100644 (file)
@@ -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 /*, ... */ ) {
index f751832..e1d7328 100644 (file)
@@ -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 /*, ... */ ) {
index 6c53249..cc13679 100644 (file)
@@ -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
         */
index 0f56e33..bc84976 100644 (file)
@@ -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 ) {
index cd8df5d..537e236 100644 (file)
@@ -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 ) {
index 9ac204d..aeadc93 100644 (file)
@@ -125,6 +125,8 @@ EOT;
 
        /**
         * Copy all rows from $srcTable to $dstTable
+        * @param string $srcTable
+        * @param string $dstTable
         */
        function sync( $srcTable, $dstTable ) {
                $batchSize = 1000;
index 7fca377..5f77637 100644 (file)
@@ -343,6 +343,7 @@ class TextPassDumper extends BackupDumper {
 
        /**
         * @throws MWException Failure to parse XML input
+        * @param string $input
         * @return bool
         */
        function readDump( $input ) {
index 0d3e643..88776f4 100644 (file)
@@ -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 ) {
index 3d30b83..bd99845 100644 (file)
@@ -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;
index 074388f..d40fec6 100644 (file)
@@ -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 ) {
index 4ce9474..6702209 100644 (file)
@@ -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 ) {
index 913e9f0..5093cb3 100644 (file)
@@ -23,6 +23,9 @@
  * @author Rob Church <robchur@gmail.com>
  */
 
+/**
+ * @param bool $delete
+ */
 function PurgeRedundantText( $delete = false ) {
 
        # Data should come off the master, wrapped in a transaction
index 0f337ec..cfffbbc 100644 (file)
@@ -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" );
index 307d0b0..910f56b 100644 (file)
@@ -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;
index dff5cb8..290f164 100644 (file)
@@ -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';
index b9493cd..14a1502 100644 (file)
@@ -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 ) {
index 19c1d24..5bee7f9 100644 (file)
@@ -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' );
index 9b8714d..99ba3b8 100644 (file)
@@ -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();
index f82a756..2fce6bf 100644 (file)
@@ -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 );
index f920ce9..56c15b2 100644 (file)
@@ -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 ) {
index 1f1d750..3be9f2c 100644 (file)
@@ -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 );
index b2f7fac..e0a72fd 100644 (file)
@@ -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: