Fixed some @params documentation (tests)
authorumherirrender <umherirrender_de.wp@web.de>
Thu, 17 Apr 2014 18:43:42 +0000 (20:43 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Thu, 17 Apr 2014 18:43:42 +0000 (20:43 +0200)
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.
Also added some missing @param.

Change-Id: Ic8aaf0a93796b97d0fa4617c1f86ff59f4b36131

48 files changed:
tests/parser/ParserTestResult.php
tests/parser/parserTest.inc
tests/phpunit/MediaWikiTestCase.php
tests/phpunit/includes/CollationTest.php
tests/phpunit/includes/EditPageTest.php
tests/phpunit/includes/ExternalStoreTest.php
tests/phpunit/includes/LinkFilterTest.php
tests/phpunit/includes/SanitizerTest.php
tests/phpunit/includes/TitleTest.php
tests/phpunit/includes/WikiPageTest.php
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/api/ApiTestContext.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/format/ApiFormatTestBase.php
tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
tests/phpunit/includes/api/query/ApiQueryTestBase.php
tests/phpunit/includes/changes/RecentChangeTest.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/db/ORMRowTest.php
tests/phpunit/includes/exception/MWExceptionTest.php
tests/phpunit/includes/filerepo/StoreBatchTest.php
tests/phpunit/includes/json/FormatJsonTest.php
tests/phpunit/includes/libs/ProcessCacheLRUTest.php
tests/phpunit/includes/media/FormatMetadataTest.php
tests/phpunit/includes/media/GIFMetadataExtractorTest.php
tests/phpunit/includes/media/GIFTest.php
tests/phpunit/includes/media/PNGTest.php
tests/phpunit/includes/media/SVGTest.php
tests/phpunit/includes/media/XMPTest.php
tests/phpunit/includes/parser/MagicVariableTest.php
tests/phpunit/includes/parser/MediaWikiParserTest.php
tests/phpunit/includes/parser/NewParserTest.php
tests/phpunit/includes/search/SearchEngineTest.php
tests/phpunit/includes/specials/SpecialSearchTest.php
tests/phpunit/includes/title/MediaWikiTitleCodecTest.php
tests/phpunit/includes/upload/UploadStashTest.php
tests/phpunit/languages/LanguageSrTest.php
tests/phpunit/languages/LanguageUzTest.php
tests/phpunit/maintenance/DumpTestCase.php
tests/phpunit/maintenance/MaintenanceTest.php
tests/phpunit/maintenance/backupPrefetchTest.php
tests/phpunit/maintenance/backupTextPassTest.php
tests/phpunit/maintenance/backup_LogTest.php
tests/phpunit/maintenance/fetchTextTest.php
tests/phpunit/maintenance/getSlaveServerTest.php
tests/phpunit/skins/SideBarTest.php
tests/phpunit/suites/UploadFromUrlTestSuite.php
tests/testHelpers.inc

index 7b0fc44..7d9415a 100644 (file)
@@ -27,9 +27,9 @@ class ParserTestResult {
        public $actual;
 
        /**
-        * @param $description string A short text describing the parser test
-        *        usually the text in the parser test .txt file.  The description
-        *        is later available using the property $description.
+        * @param string $description A short text describing the parser test
+        *   usually the text in the parser test .txt file.  The description
+        *   is later available using the property $description.
         */
        public function __construct( $description ) {
                $this->description = $description;
index e021dcc..27d6bca 100644 (file)
@@ -80,6 +80,7 @@ class ParserTest {
        /**
         * Sets terminal colorization and diff/quick modes depending on OS and
         * command-line options (--color and --quick).
+        * @param array $options
         */
        public function __construct( $options = array() ) {
                # Only colorize output if stdout is a terminal.
@@ -299,6 +300,7 @@ class ParserTest {
        /**
         * Remove last character if it is a newline
         * @group utility
+        * @param string $s
         */
        public static function chomp( $s ) {
                if ( substr( $s, -1 ) === "\n" ) {
@@ -311,6 +313,7 @@ class ParserTest {
        /**
         * Run a fuzz test series
         * Draw input from a set of test files
+        * @param array $filenames
         */
        function fuzzTest( $filenames ) {
                $GLOBALS['wgContLang'] = Language::factory( 'en' );
@@ -381,6 +384,7 @@ class ParserTest {
 
        /**
         * Get an input dictionary from a set of parser test files
+        * @param array $filenames
         */
        function getFuzzInput( $filenames ) {
                $dict = '';
@@ -444,8 +448,8 @@ class ParserTest {
         * Prints status updates on stdout and counts up the total
         * number and percentage of passed tests.
         *
-        * @param $filenames Array of strings
-        * @return Boolean: true if passed all tests, false if any tests failed.
+        * @param array $filenames Array of strings
+        * @return bool True if passed all tests, false if any tests failed.
         */
        public function runTestsFromFiles( $filenames ) {
                $ok = false;
@@ -523,12 +527,12 @@ class ParserTest {
         * and compare the output against the expected results.
         * Prints status and explanatory messages to stdout.
         *
-        * @param $desc String: test's description
-        * @param $input String: wikitext to try rendering
-        * @param $result String: result to output
-        * @param $opts Array: test's options
-        * @param $config String: overrides for global variables, one per line
-        * @return Boolean
+        * @param string $desc Test's description
+        * @param string $input Wikitext to try rendering
+        * @param string $result Result to output
+        * @param array $opts Test's options
+        * @param string $config Overrides for global variables, one per line
+        * @return bool
         */
        public function runTest( $desc, $input, $result, $opts, $config ) {
                if ( $this->showProgress ) {
@@ -608,6 +612,7 @@ class ParserTest {
 
        /**
         * Refactored in 1.22 to use ParserTestResult
+        * @param ParserTestResult $testResult
         */
        function showTestResult( ParserTestResult $testResult ) {
                if ( $testResult->isSuccess() ) {
@@ -621,9 +626,9 @@ class ParserTest {
 
        /**
         * Use a regex to find out the value of an option
-        * @param $key String: name of option val to retrieve
-        * @param $opts array: Options array to look in
-        * @param $default Mixed: default value returned if not found
+        * @param string $key Name of option val to retrieve
+        * @param array $opts Options array to look in
+        * @param mixed $default Default value returned if not found
         */
        private static function getOptionValue( $key, $opts, $default ) {
                $key = strtolower( $key );
@@ -725,6 +730,8 @@ class ParserTest {
        /**
         * Set up the global variables for a consistent environment for each test.
         * Ideally this should replace the global configuration entirely.
+        * @param string $opts
+        * @param string $config
         */
        private function setupGlobals( $opts = '', $config = '' ) {
                # Find out values for some special options.
@@ -1049,7 +1056,7 @@ class ParserTest {
         * Create a dummy uploads directory which will contain a couple
         * of files in order to pass existence tests.
         *
-        * @return String: the directory
+        * @return string The directory
         */
        private function setupUploadDir() {
                global $IP;
@@ -1101,6 +1108,7 @@ class ParserTest {
 
        /**
         * Remove the dummy uploads directory
+        * @param string $dir
         */
        private function teardownUploadDir( $dir ) {
                if ( $this->keepUploads ) {
@@ -1190,7 +1198,7 @@ class ParserTest {
 
        /**
         * Delete the specified files, if they exist.
-        * @param $files Array: full paths to files to delete.
+        * @param array $files Full paths to files to delete.
         */
        private static function deleteFiles( $files ) {
                foreach ( $files as $file ) {
@@ -1202,7 +1210,7 @@ class ParserTest {
 
        /**
         * Delete the specified directories, if they exist. Must be empty.
-        * @param $dirs Array: full paths to directories to delete.
+        * @param array $dirs Full paths to directories to delete.
         */
        private static function deleteDirs( $dirs ) {
                foreach ( $dirs as $dir ) {
@@ -1214,6 +1222,7 @@ class ParserTest {
 
        /**
         * "Running test $desc..."
+        * @param string $desc
         */
        protected function showTesting( $desc ) {
                print "Running test $desc... ";
@@ -1224,8 +1233,8 @@ class ParserTest {
         *
         * Refactored in 1.22 to use ParserTestResult
         *
-        * @param $testResult ParserTestResult
-        * @return Boolean
+        * @param ParserTestResult $testResult
+        * @return bool
         */
        protected function showSuccess( ParserTestResult $testResult ) {
                if ( $this->showProgress ) {
@@ -1241,8 +1250,8 @@ class ParserTest {
         *
         * Refactored in 1.22 to use ParserTestResult
         *
-        * @param $testResult ParserTestResult
-        * @return Boolean
+        * @param ParserTestResult $testResult
+        * @return bool
         */
        protected function showFailure( ParserTestResult $testResult ) {
                if ( $this->showFailure ) {
@@ -1274,11 +1283,11 @@ class ParserTest {
         * Run given strings through a diff and return the (colorized) output.
         * Requires writable /tmp directory and a 'diff' command in the PATH.
         *
-        * @param $input String
-        * @param $output String
-        * @param $inFileTail String: tailing for the input file name
-        * @param $outFileTail String: tailing for the output file name
-        * @return String
+        * @param string $input
+        * @param string $output
+        * @param string $inFileTail Tailing for the input file name
+        * @param string $outFileTail Tailing for the output file name
+        * @return string
         */
        protected function quickDiff( $input, $output,
                $inFileTail = 'expected', $outFileTail = 'actual'
@@ -1311,8 +1320,8 @@ class ParserTest {
        /**
         * Write the given string to a file, adding a final newline.
         *
-        * @param $data String
-        * @param $filename String
+        * @param string $data
+        * @param string $filename
         */
        private function dumpToFile( $data, $filename ) {
                $file = fopen( $filename, "wt" );
@@ -1324,8 +1333,8 @@ class ParserTest {
         * Colorize unified diff output if set for ANSI color output.
         * Subtractions are colored blue, additions red.
         *
-        * @param $text String
-        * @return String
+        * @param string $text
+        * @return string
         */
        protected function colorDiff( $text ) {
                return preg_replace(
@@ -1338,7 +1347,7 @@ class ParserTest {
        /**
         * Show "Reading tests from ..."
         *
-        * @param $path String
+        * @param string $path
         */
        public function showRunFile( $path ) {
                print $this->term->color( 1 ) .
@@ -1349,10 +1358,10 @@ class ParserTest {
 
        /**
         * Insert a temporary test article
-        * @param $name String: the title, including any prefix
-        * @param $text String: the article text
-        * @param $line Integer: the input line number, for reporting errors
-        * @param $ignoreDuplicate Boolean: whether to silently ignore duplicate pages
+        * @param string $name The title, including any prefix
+        * @param string $text The article text
+        * @param int $line The input line number, for reporting errors
+        * @param bool $ignoreDuplicate Whether to silently ignore duplicate pages
         */
        public static function addArticle( $name, $text, $line = 'unknown', $ignoreDuplicate = '' ) {
                global $wgCapitalLinks;
@@ -1390,8 +1399,8 @@ class ParserTest {
         * application to our scary parser. If the hook is not installed,
         * abort processing of this file.
         *
-        * @param $name String
-        * @return Bool true if tag hook is present
+        * @param string $name
+        * @return bool True if tag hook is present
         */
        public function requireHook( $name ) {
                global $wgParser;
@@ -1413,8 +1422,8 @@ class ParserTest {
         * application to our scary parser. If the hook is not installed,
         * abort processing of this file.
         *
-        * @param $name String
-        * @return Bool true if function hook is present
+        * @param string $name
+        * @return bool True if function hook is present
         */
        public function requireFunctionHook( $name ) {
                global $wgParser;
@@ -1435,8 +1444,8 @@ class ParserTest {
         * Run the "tidy" command on text if the $wgUseTidy
         * global is true
         *
-        * @param $text String: the text to tidy
-        * @return String
+        * @param string $text The text to tidy
+        * @return string
         */
        private function tidy( $text ) {
                global $wgUseTidy;
index 3742a54..1c21e62 100644 (file)
@@ -157,7 +157,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         *
         * @since 1.20
         *
-        * @return string absolute name of the temporary file
+        * @return string Absolute name of the temporary file
         */
        protected function getNewTempFile() {
                $fileName = tempnam( wfTempDir(), 'MW_PHPUnit_' . get_class( $this ) . '_' );
@@ -512,7 +512,7 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * even if using different parameters.
         *
         * @param DatabaseBase $db The database connection
-        * @param String $prefix The prefix to use for the new table set (aka schema).
+        * @param string $prefix The prefix to use for the new table set (aka schema).
         *
         * @throws MWException if the database table prefix is already $prefix
         */
@@ -599,6 +599,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * Used as a compatibility method for phpunit < 3.7.32
+        * @param string $value
+        * @param string $msg
         */
        private function assertEmpty2( $value, $msg ) {
                return $this->assertTrue( $value == '', $msg );
@@ -660,6 +662,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * @since 1.18
+        * @param string $offset
+        * @return mixed
         */
        public function getCliArg( $offset ) {
                if ( isset( MediaWikiPHPUnitCommand::$additionalOptions[$offset] ) ) {
@@ -669,6 +673,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
 
        /**
         * @since 1.18
+        * @param string $offset
+        * @param mixed $value
         */
        public function setCliArg( $offset, $value ) {
                MediaWikiPHPUnitCommand::$additionalOptions[$offset] = $value;
@@ -680,7 +686,6 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * @since 1.19
         *
         * @param string $function
-        * @return null
         */
        public function hideDeprecated( $function ) {
                wfSuppressWarnings();
@@ -1007,6 +1012,8 @@ abstract class MediaWikiTestCase extends PHPUnit_Framework_TestCase {
         * test whenever it is not loaded.
         *
         * @since 1.21
+        * @param string $extName
+        * @return bool
         */
        protected function checkPHPExtension( $extName ) {
                $loaded = extension_loaded( $extName );
index 213e610..74b1296 100644 (file)
@@ -20,9 +20,9 @@ class CollationTest extends MediaWikiLangTestCase {
         * prefix of "XY". Our collation
         * code makes this assumption.
         *
-        * @param $lang String Language code for collator
-        * @param $base String Base string
-        * @param $extended String String containing base as a prefix.
+        * @param string $lang Language code for collator
+        * @param string $base Base string
+        * @param string $extended String containing base as a prefix.
         *
         * @dataProvider prefixDataProvider
         */
@@ -81,9 +81,9 @@ class CollationTest extends MediaWikiLangTestCase {
        /**
         * Test correct first letter is fetched.
         *
-        * @param $collation String Collation name (aka uca-en)
-        * @param $string String String to get first letter of
-        * @param $firstLetter String Expected first letter.
+        * @param string $collation Collation name (aka uca-en)
+        * @param string $string String to get first letter of
+        * @param string $firstLetter Expected first letter.
         *
         * @dataProvider firstLetterProvider
         */
index 0dee6b0..4da8448 100644 (file)
@@ -67,9 +67,9 @@ class EditPageTest extends MediaWikiLangTestCase {
        /**
         * Performs an edit and checks the result.
         *
-        * @param String|Title $title The title of the page to edit
-        * @param String|null $baseText Some text to create the page with before attempting the edit.
-        * @param User|String|null $user The user to perform the edit as.
+        * @param string|Title $title The title of the page to edit
+        * @param string|null $baseText Some text to create the page with before attempting the edit.
+        * @param User|string|null $user The user to perform the edit as.
         * @param array $edit An array of request parameters used to define the edit to perform.
         *              Some well known fields are:
         *              * wpTextbox1: the text to submit
@@ -82,9 +82,9 @@ class EditPageTest extends MediaWikiLangTestCase {
         *              * wpWatchthis: whether to watch the page
         * @param int|null $expectedCode The expected result code (EditPage::AS_XXX constants).
         *                  Set to null to skip the check. Defaults to EditPage::AS_OK.
-        * @param String|null $expectedText The text expected to be on the page after the edit.
+        * @param string|null $expectedText The text expected to be on the page after the edit.
         *                  Set to null to skip the check.
-        * @param String|null $message An optional message to show along with any error message.
+        * @param string|null $message An optional message to show along with any error message.
         *
         * @return WikiPage The page that was just edited, useful for getting the edit's rev_id, etc.
         */
index ba155a4..cd3364e 100644 (file)
@@ -57,7 +57,7 @@ class ExternalStoreFOO {
 
        /**
         * Fetch data from given URL
-        * @param $url String: an url of the form FOO://cluster/id or FOO://cluster/id/itemid.
+        * @param string $url An url of the form FOO://cluster/id or FOO://cluster/id/itemid.
         * @return mixed
         */
        function fetchFromURL( $url ) {
index 41207b7..f2c9cb4 100644 (file)
@@ -34,7 +34,7 @@ class LinkFilterTest extends MediaWikiLangTestCase {
         *
         * Takes an array as created by LinkFilter::makeLikeArray() and creates a regex from it
         *
-        * @param Array $like Array as created by LinkFilter::makeLikeArray()
+        * @param array $like Array as created by LinkFilter::makeLikeArray()
         * @return string Regex
         */
        function createRegexFromLIKE( $like ) {
@@ -185,9 +185,9 @@ class LinkFilterTest extends MediaWikiLangTestCase {
         *
         * @dataProvider provideValidPatterns
         *
-        * @param String $protocol Protocol, e.g. 'http://' or 'mailto:'
-        * @param String $pattern Search pattern to feed to LinkFilter::makeLikeArray
-        * @param String $url URL to feed to wfMakeUrlIndexes
+        * @param string $protocol Protocol, e.g. 'http://' or 'mailto:'
+        * @param string $pattern Search pattern to feed to LinkFilter::makeLikeArray
+        * @param string $url URL to feed to wfMakeUrlIndexes
         * @param bool $shouldBeFound Should the URL be found? (defaults true)
         */
        function testMakeLikeArrayWithValidPatterns( $protocol, $pattern, $url, $shouldBeFound = true ) {
@@ -260,7 +260,7 @@ class LinkFilterTest extends MediaWikiLangTestCase {
         *
         * @dataProvider provideInvalidPatterns
         *
-        * @param $pattern string: Invalid search pattern
+        * @param string $pattern Invalid search pattern
         */
        function testMakeLikeArrayWithInvalidPatterns( $pattern ) {
 
index 97abf80..f5551ed 100644 (file)
@@ -91,8 +91,8 @@ class SanitizerTest extends MediaWikiTestCase {
         * @covers Sanitizer::removeHTMLtags
         * @dataProvider provideHtml5Tags
         *
-        * @param String $tag Name of an HTML5 element (ie: 'video')
-        * @param Boolean $escaped Wheter sanitizer let the tag in or escape it (ie: '&lt;video&gt;')
+        * @param string $tag Name of an HTML5 element (ie: 'video')
+        * @param bool $escaped Whether sanitizer let the tag in or escape it (ie: '&lt;video&gt;')
         */
        public function testRemovehtmltagsOnHtml5Tags( $tag, $escaped ) {
                $this->setMwGlobals( array(
index 8093824..118cf95 100644 (file)
@@ -580,8 +580,8 @@ class TitleTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideGetFragment
         *
-        * @param $full
-        * @param $fragment
+        * @param string $full
+        * @param string $fragment
         */
        public function testGetFragment( $full, $fragment ) {
                $title = Title::newFromText( $full );
index 9b41a9c..9470359 100644 (file)
@@ -56,7 +56,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
 
        /**
         * @param Title $title
-        * @param String $model
+        * @param string $model
         * @return WikiPage
         */
        protected function newPage( $title, $model = null ) {
@@ -73,8 +73,8 @@ class WikiPageTest extends MediaWikiLangTestCase {
        }
 
        /**
-        * @param String|Title|WikiPage $page
-        * @param String $text
+        * @param string|Title|WikiPage $page
+        * @param string $text
         * @param int $model
         *
         * @return WikiPage
index ad297dd..843c88d 100644 (file)
@@ -43,11 +43,11 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
 
        /**
         * Edits or creates a page/revision
-        * @param $pageName string page title
-        * @param $text string content of the page
-        * @param $summary string optional summary string for the revision
-        * @param $defaultNs int optional namespace id
-        * @return array as returned by WikiPage::doEditContent()
+        * @param string $pageName page title
+        * @param string $text content of the page
+        * @param string $summary optional summary string for the revision
+        * @param int $defaultNs optional namespace id
+        * @return array Array as returned by WikiPage::doEditContent()
         */
        protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) {
                $title = Title::newFromText( $pageName, $defaultNs );
@@ -114,10 +114,10 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
         * Add an edit token to the API request
         * This is cheating a bit -- we grab a token in the correct format and then add it to the pseudo-session and to the
         * request, without actually requesting a "real" edit token
-        * @param $params Array: key-value API params
-        * @param $session Array|null: session array
-        * @param $user User|null A User object for the context
-        * @return mixed result of the API call
+        * @param array $params Key-value API params
+        * @param array|null $session session array
+        * @param User|null $user A User object for the context
+        * @return mixed Result of the API call
         * @throws Exception in case wsToken is not set in the session
         */
        protected function doApiRequestWithToken( array $params, array $session = null, User $user = null ) {
index 80d7ea6..17dad1f 100644 (file)
@@ -5,8 +5,8 @@ class ApiTestContext extends RequestContext {
        /**
         * Returns a DerivativeContext with the request variables in place
         *
-        * @param $request WebRequest request object including parameters and session
-        * @param $user User or null
+        * @param WebRequest $request WebRequest request object including parameters and session
+        * @param User|null $user User or null
         * @return DerivativeContext
         */
        public function newTestContext( WebRequest $request, User $user = null ) {
index c0612d1..877e353 100644 (file)
@@ -96,10 +96,10 @@ class RandomImageGenerator {
        /**
         * Writes random images with random filenames to disk in the directory you specify, or current working directory
         *
-        * @param int $number number of filenames to write
-        * @param string $format optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
-        * @param string $dir directory, optional (will default to current working directory)
-        * @return array filenames we just wrote
+        * @param int $number Number of filenames to write
+        * @param string $format Optional, must be understood by ImageMagick, such as 'jpg' or 'gif'
+        * @param string $dir Directory, optional (will default to current working directory)
+        * @return array Filenames we just wrote
         */
        function writeImages( $number, $format = 'jpg', $dir = null ) {
                $filenames = $this->getRandomFilenames( $number, $format, $dir );
@@ -224,9 +224,9 @@ class RandomImageGenerator {
         * Based on image specification, write a very simple SVG file to disk.
         * Ignores the background spec because transparency is cool. :)
         *
-        * @param array $spec spec describing background and shapes to draw
-        * @param string $format file format to write (which is obviously always svg here)
-        * @param string $filename filename to write to
+        * @param array $spec Spec describing background and shapes to draw
+        * @param string $format File format to write (which is obviously always svg here)
+        * @param string $filename Filename to write to
         *
         * @throws Exception
         */
@@ -254,9 +254,9 @@ class RandomImageGenerator {
 
        /**
         * Based on an image specification, write such an image to disk, using Imagick PHP extension
-        * @param array $spec spec describing background and circles to draw
-        * @param string $format file format to write
-        * @param string $filename filename to write to
+        * @param array $spec Spec describing background and circles to draw
+        * @param string $format File format to write
+        * @param string $filename Filename to write to
         */
        public function writeImageWithApi( $spec, $format, $filename ) {
                // this is a hack because I can't get setImageOrientation() to work. See below.
@@ -309,8 +309,8 @@ class RandomImageGenerator {
        /**
         * Given an image specification, produce rotated version
         * This is used when simulating a rotated image capture with Exif orientation
-        * @param $spec Object returned by getImageSpec
-        * @param $matrix 2x2 transformation matrix
+        * @param array $spec Returned by getImageSpec
+        * @param array $matrix 2x2 transformation matrix
         * @return array transformed Spec
         */
        private static function rotateImageSpec( &$spec, $matrix ) {
@@ -368,10 +368,10 @@ class RandomImageGenerator {
         *   -draw 'fill rgb(99,123,231) circle 59,39 56,57' \
         *   -draw 'fill rgb(240,12,32)  circle 50,21 50,3'  filename.png
         *
-        * @param array $spec spec describing background and shapes to draw
-        * @param string $format file format to write (unused by this method but kept so it has the same signature as
+        * @param array $spec Spec describing background and shapes to draw
+        * @param string $format File format to write (unused by this method but kept so it has the same signature as
         * writeImageWithApi)
-        * @param string $filename filename to write to
+        * @param string $filename Filename to write to
         *
         * @return bool
         */
@@ -435,7 +435,7 @@ class RandomImageGenerator {
         * @param int $number_desired number of lines desired
         *
         * @throws Exception
-        * @return array of exactly n elements, drawn randomly from lines the file
+        * @return array Array of exactly n elements, drawn randomly from lines the file
         */
        private function getRandomLines( $number_desired ) {
                $filepath = $this->dictionaryFile;
index 24d8cb8..5f6d53c 100644 (file)
@@ -5,7 +5,7 @@ abstract class ApiFormatTestBase extends ApiTestCase {
        /**
         * @param string $format
         * @param array $params
-        * @param $data
+        * @param array $data
         *
         * @return string
         */
index 1b5a05e..f1b773a 100644 (file)
@@ -33,6 +33,12 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
 
        /**
         * Run query() and compare against expected values
+        * @param array $expected
+        * @param array $params Api parameters
+        * @param int $expectedCount Max number of iterations
+        * @param string $id Unit test id
+        * @param bool $useContinue true to use smart continue
+        * @return mixed Merged results data array
         */
        protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) {
                $result = $this->query( $params, $expectedCount, $id, $continue );
@@ -41,11 +47,11 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
 
        /**
         * Run query in a loop until no more values are available
-        * @param array $params api parameters
-        * @param int $expectedCount max number of iterations
-        * @param string $id unit test id
-        * @param boolean $useContinue true to use smart continue
-        * @return mixed: merged results data array
+        * @param array $params Api parameters
+        * @param int $expectedCount Max number of iterations
+        * @param string $id Unit test id
+        * @param bool $useContinue true to use smart continue
+        * @return mixed Merged results data array
         * @throws Exception
         */
        protected function query( $params, $expectedCount, $id, $useContinue = true ) {
index a657459..1b9c1ce 100644 (file)
@@ -83,7 +83,7 @@ STR;
 
        /**
         * Checks that the request's result matches the expected results.
-        * @param $values array is a two element array( request, expected_results )
+        * @param array $values Array is a two element array( request, expected_results )
         * @throws Exception
         */
        protected function check( $values ) {
index c63675e..98903f1 100644 (file)
@@ -253,12 +253,12 @@ class RecentChangeTest extends MediaWikiTestCase {
        */
 
        /**
-        * @param $expected String Expected IRC text without colors codes
-        * @param $type String Log type (move, delete, suppress, patrol ...)
-        * @param $action String A log type action
-        * @param $params
-        * @param $comment String (optional) A comment for the log action
-        * @param $msg String (optional) A message for PHPUnit :-)
+        * @param string $expected Expected IRC text without colors codes
+        * @param string $type Log type (move, delete, suppress, patrol ...)
+        * @param string $action A log type action
+        * @param array $params
+        * @param string $comment (optional) A comment for the log action
+        * @param string $msg (optional) A message for PHPUnit :-)
         */
        protected function assertIRCComment( $expected, $type, $action, $params,
                $comment = null, $msg = ''
index 080ff54..f21aad8 100644 (file)
@@ -362,16 +362,16 @@ class DummyContentForTesting extends AbstractContent {
        }
 
        /**
-        * @return String a string representing the content in a way useful for building a full text search index.
-        *         If no useful representation exists, this method returns an empty string.
+        * @return string A string representing the content in a way useful for building a full text search index.
+        *   If no useful representation exists, this method returns an empty string.
         */
        public function getTextForSearchIndex() {
                return '';
        }
 
        /**
-        * @return String the wikitext to include when another page includes this  content, or false if the content is not
-        *  includable in a wikitext page.
+        * @return string|bool The wikitext to include when another page includes this  content,
+        *  or false if the content is not includable in a wikitext page.
         */
        public function getWikitextForTransclusion() {
                return false;
@@ -429,9 +429,9 @@ class DummyContentForTesting extends AbstractContent {
         * Returns true if this content is countable as a "real" wiki page, provided
         * that it's also in a countable location (e.g. a current revision in the main namespace).
         *
-        * @param boolean $hasLinks if it is known whether this content contains links, provide this information here,
+        * @param bool $hasLinks if it is known whether this content contains links, provide this information here,
         *  to avoid redundant parsing to find out.
-        * @return boolean
+        * @return bool
         */
        public function isCountable( $hasLinks = null ) {
                return false;
@@ -441,9 +441,8 @@ class DummyContentForTesting extends AbstractContent {
         * @param Title $title
         * @param int $revId Unused.
         * @param null|ParserOptions $options
-        * @param boolean $generateHtml whether to generate Html (default: true). If false,
-        *  the result of calling getText() on the ParserOutput object returned by
-        *   this method is undefined.
+        * @param bool $generateHtml whether to generate Html (default: true). If false, the result
+        *  of calling getText() on the ParserOutput object returned by this method is undefined.
         *
         * @return ParserOutput
         */
index 27d4d0e..4ff6165 100644 (file)
@@ -71,7 +71,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
        /**
         * @since 1.20
         * @param array $data
-        * @param boolean $loadDefaults
+        * @param bool $loadDefaults
         * @return IORMRow
         */
        protected function getRowInstance( array $data, $loadDefaults ) {
index 24741a3..c45de36 100644 (file)
@@ -167,9 +167,9 @@ class MWExceptionTest extends MediaWikiTestCase {
         *
         * @covers MWExceptionHandler::jsonSerializeException
         *
-        * @param $expectedKeyType String Type expected as returned by gettype()
-        * @param $exClass String An exception class (ie: Exception, MWException)
-        * @param $key String Name of the key to validate in the serialized JSON
+        * @param string $expectedKeyType Type expected as returned by gettype()
+        * @param string $exClass An exception class (ie: Exception, MWException)
+        * @param string $key Name of the key to validate in the serialized JSON
         * @dataProvider provideJsonSerializedKeys
         */
        public function testJsonserializeexceptionKeys( $expectedKeyType, $exClass, $key ) {
index 8fb85b6..787d83c 100644 (file)
@@ -65,9 +65,9 @@ class StoreBatchTest extends MediaWikiTestCase {
        /**
         * Store a file or virtual URL source into a media file name.
         *
-        * @param $originalName string The title of the image
-        * @param $srcPath string The filepath or virtual URL
-        * @param $flags integer Flags to pass into repo::store().
+        * @param string $originalName The title of the image
+        * @param string $srcPath The filepath or virtual URL
+        * @param int $flags Flags to pass into repo::store().
         * @return FileRepoStatus
         */
        private function storeit( $originalName, $srcPath, $flags ) {
@@ -85,10 +85,10 @@ class StoreBatchTest extends MediaWikiTestCase {
        /**
         * Test storing a file using different flags.
         *
-        * @param $fn string The title of the image
-        * @param $infn string The name of the file (in the filesystem)
-        * @param $otherfn string The name of the different file (in the filesystem)
-        * @param $fromrepo bool 'true' if we want to copy from a virtual URL out of the Repo.
+        * @param string $fn The title of the image
+        * @param string $infn The name of the file (in the filesystem)
+        * @param string $otherfn The name of the different file (in the filesystem)
+        * @param bool $fromrepo 'true' if we want to copy from a virtual URL out of the Repo.
         */
        private function storecohort( $fn, $infn, $otherfn, $fromrepo ) {
                $f = $this->storeit( $fn, $infn, 0 );
index 307b355..bf58ee3 100644 (file)
@@ -127,7 +127,7 @@ class FormatJsonTest extends MediaWikiTestCase {
         * Generate a set of test cases for a particular combination of encoder options.
         *
         * @param array $unescapedGroups List of character groups to leave unescaped
-        * @return array: Arrays of unencoded strings and corresponding encoded strings
+        * @return array Arrays of unencoded strings and corresponding encoded strings
         */
        private static function getEncodeTestCases( array $unescapedGroups ) {
                $groups = array(
index 3eae810..1a8a1e5 100644 (file)
@@ -114,8 +114,8 @@ class ProcessCacheLRUTest extends MediaWikiTestCase {
         * delete the older key.
         *
         * @dataProvider provideCacheFilling
-        * @param $cacheMaxEntries Maximum entry the created cache will hold
-        * @param $entryToFill Number of entries to insert in the created cache.
+        * @param int $cacheMaxEntries Maximum entry the created cache will hold
+        * @param int $entryToFill Number of entries to insert in the created cache.
         */
        public function testFillingCache( $cacheMaxEntries, $entryToFill, $msg = '' ) {
                $cache = new ProcessCacheLRUTestable( $cacheMaxEntries );
index 605dfa8..a0ab92c 100644 (file)
@@ -51,8 +51,8 @@ class FormatMetadataTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected Integer Total image area
+        * @param string $filename
+        * @param int $expected Total image area
         * @dataProvider provideFlattenArray
         * @covers FormatMetadata::flattenArray
         */
index 9e3f924..3491112 100644 (file)
@@ -9,8 +9,8 @@ class GIFMetadataExtractorTest extends MediaWikiTestCase {
 
        /**
         * Put in a file, and see if the metadata coming out is as expected.
-        * @param $filename String
-        * @param $expected Array The extracted metadata.
+        * @param string $filename
+        * @param array $expected The extracted metadata.
         * @dataProvider provideGetMetadata
         * @covers GIFMetadataExtractor::getMetadata
         */
index 7bd04b7..d750540 100644 (file)
@@ -36,8 +36,8 @@ class GIFHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String basename of the file to check
-        * @param $expected boolean Expected result.
+        * @param string $filename Basename of the file to check
+        * @param bool $expected Expected result.
         * @dataProvider provideIsAnimated
         * @covers GIFHandler::isAnimatedImage
         */
@@ -55,8 +55,8 @@ class GIFHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected Integer Total image area
+        * @param string $filename
+        * @param int $expected Total image area
         * @dataProvider provideGetImageArea
         * @covers GIFHandler::getImageArea
         */
@@ -74,8 +74,8 @@ class GIFHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $metadata String Serialized metadata
-        * @param $expected Integer One of the class constants of GIFHandler
+        * @param string $metadata Serialized metadata
+        * @param int $expected One of the class constants of GIFHandler
         * @dataProvider provideIsMetadataValid
         * @covers GIFHandler::isMetadataValid
         */
@@ -95,8 +95,8 @@ class GIFHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected String Serialized array
+        * @param string $filename
+        * @param string $expected Serialized array
         * @dataProvider provideGetMetadata
         * @covers GIFHandler::getMetadata
         */
@@ -114,8 +114,8 @@ class GIFHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected String Serialized array
+        * @param string $filename
+        * @param string $expected Serialized array
         * @dataProvider provideGetIndependentMetaArray
         * @covers GIFHandler::getCommonMetaArray
         */
index a47dc4a..aa73e2d 100644 (file)
@@ -36,8 +36,8 @@ class PNGHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String basename of the file to check
-        * @param $expected boolean Expected result.
+        * @param string $filename basename of the file to check
+        * @param bool $expected Expected result.
         * @dataProvider provideIsAnimated
         * @covers PNGHandler::isAnimatedImage
         */
@@ -55,8 +55,8 @@ class PNGHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected Integer Total image area
+        * @param string $filename
+        * @param int $expected Total image area
         * @dataProvider provideGetImageArea
         * @covers PNGHandler::getImageArea
         */
@@ -76,8 +76,8 @@ class PNGHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $metadata String Serialized metadata
-        * @param $expected Integer One of the class constants of PNGHandler
+        * @param string $metadata Serialized metadata
+        * @param int $expected One of the class constants of PNGHandler
         * @dataProvider provideIsMetadataValid
         * @covers PNGHandler::isMetadataValid
         */
@@ -97,8 +97,8 @@ class PNGHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected String Serialized array
+        * @param string $filename
+        * @param string $expected Serialized array
         * @dataProvider provideGetMetadata
         * @covers PNGHandler::getMetadata
         */
@@ -117,8 +117,8 @@ class PNGHandlerTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected Array Expected standard metadata
+        * @param string $filename
+        * @param array $expected Expected standard metadata
         * @dataProvider provideGetIndependentMetaArray
         * @covers PNGHandler::getCommonMetaArray
         */
index dafcae7..97e6c43 100644 (file)
@@ -24,8 +24,8 @@ class SvgTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param $filename String
-        * @param $expected Array The expected independent metadata
+        * @param string $filename
+        * @param array $expected The expected independent metadata
         * @dataProvider providerGetIndependentMetaArray
         * @covers SvgHandler::getCommonMetaArray
         */
index 61ba189..25ae1e6 100644 (file)
@@ -13,9 +13,9 @@ class XMPTest extends MediaWikiTestCase {
        /**
         * Put XMP in, compare what comes out...
         *
-        * @param $xmp String the actual xml data.
-        * @param $expected Array expected result of parsing the xmp.
-        * @param $info String Short sentence on what's being tested.
+        * @param string $xmp The actual xml data.
+        * @param array $expected Expected result of parsing the xmp.
+        * @param string $info Short sentence on what's being tested.
         *
         * @throws Exception
         * @dataProvider provideXMPParse
index c2c97c0..2ad2735 100644 (file)
@@ -54,8 +54,8 @@ class MagicVariableTest extends MediaWikiTestCase {
        }
 
        /**
-        * @param int $num upper limit for numbers
-        * @return array of numbers from 1 up to $num
+        * @param int $num Upper limit for numbers
+        * @return array Array of numbers from 1 up to $num
         */
        private static function createProviderUpTo( $num ) {
                $ret = array();
@@ -67,14 +67,14 @@ class MagicVariableTest extends MediaWikiTestCase {
        }
 
        /**
-        * @return array of months numbers (as an integer)
+        * @return array Array of months numbers (as an integer)
         */
        public static function provideMonths() {
                return self::createProviderUpTo( 12 );
        }
 
        /**
-        * @return array of days numbers (as an integer)
+        * @return array Array of days numbers (as an integer)
         */
        public static function provideDays() {
                return self::createProviderUpTo( 31 );
@@ -187,9 +187,9 @@ class MagicVariableTest extends MediaWikiTestCase {
 
        /**
         * Main assertion helper for magic variables padding
-        * @param $magic string Magic variable name
-        * @param $value mixed Month or day
-        * @param $format string sprintf format for $value
+        * @param string $magic Magic variable name
+        * @param mixed $value Month or day
+        * @param string $format sprintf format for $value
         */
        private function assertMagicPadding( $magic, $value, $format ) {
                # Initialize parser timestamp as year 2010 at 12h34 56s.
@@ -212,7 +212,10 @@ class MagicVariableTest extends MediaWikiTestCase {
                $this->assertMagic( $expected, $magic );
        }
 
-       /** helper to set the parser timestamp and revision timestamp */
+       /**
+        * helper to set the parser timestamp and revision timestamp
+        * @param string $ts
+        */
        private function setParserTS( $ts ) {
                $this->testParser->Options()->setTimestamp( $ts );
                $this->testParser->mRevisionTimestamp = $ts;
@@ -220,6 +223,8 @@ class MagicVariableTest extends MediaWikiTestCase {
 
        /**
         * Assertion helper to test a magic variable output
+        * @param string|int $expected
+        * @param string $magic
         */
        private function assertMagic( $expected, $magic ) {
                if ( in_array( $magic, $this->expectedAsInteger ) ) {
index c120ca3..a506c86 100644 (file)
@@ -45,7 +45,7 @@ class MediaWikiParserTest {
         * MediaWikiParserTest::suite( MediaWikiParserTest::WITH_ALL );
         * @endcode
         *
-        * @param $flags bitwise flag to filter out the $wgParserTestFiles that
+        * @param int $flags bitwise flag to filter out the $wgParserTestFiles that
         * will be included.  Default: MediaWikiParserTest::CORE_ONLY
         *
         * @return PHPUnit_Framework_TestSuite
index 234eaf2..f3c499b 100644 (file)
@@ -400,7 +400,7 @@ class NewParserTest extends MediaWikiTestCase {
        /**
         * Get an FS upload directory (only applies to FSFileBackend)
         *
-        * @return String: the directory
+        * @return string The directory
         */
        protected function getUploadDir() {
                if ( $this->keepUploads ) {
@@ -427,7 +427,7 @@ class NewParserTest extends MediaWikiTestCase {
         * Create a dummy uploads directory which will contain a couple
         * of files in order to pass existence tests.
         *
-        * @return String: the directory
+        * @return string The directory
         */
        protected function setupUploads() {
                global $IP;
@@ -543,7 +543,7 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Delete the specified files, if they exist.
-        * @param $files Array: full paths to files to delete.
+        * @param array $files Full paths to files to delete.
         */
        private static function deleteFiles( $files ) {
                $backend = RepoGroup::singleton()->getLocalRepo()->getBackend();
@@ -575,6 +575,7 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Set the file from whose tests will be run by this instance
+        * @param string $filename
         */
        public function setParserTestFile( $filename ) {
                $this->file = $filename;
@@ -583,6 +584,11 @@ class NewParserTest extends MediaWikiTestCase {
        /**
         * @group medium
         * @dataProvider parserTestProvider
+        * @param string $desc
+        * @param string $input
+        * @param string $result
+        * @param array $opts
+        * @param array $config
         */
        public function testParserTest( $desc, $input, $result, $opts, $config ) {
                if ( $this->regex != '' && !preg_match( '/' . $this->regex . '/', $desc ) ) {
@@ -768,6 +774,7 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Get an input dictionary from a set of parser test files
+        * @param array $filenames
         */
        function getFuzzInput( $filenames ) {
                $dict = '';
@@ -821,6 +828,7 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Get a Parser object
+        * @param Preprocessor $preprocessor
         */
        function getParser( $preprocessor = null ) {
                global $wgParserConf;
@@ -855,8 +863,8 @@ class NewParserTest extends MediaWikiTestCase {
         * application to our scary parser. If the hook is not installed,
         * abort processing of this file.
         *
-        * @param $name String
-        * @return Bool true if tag hook is present
+        * @param string $name
+        * @return bool True if tag hook is present
         */
        public function requireHook( $name ) {
                global $wgParser;
@@ -876,8 +884,8 @@ class NewParserTest extends MediaWikiTestCase {
         * Run the "tidy" command on text if the $wgUseTidy
         * global is true
         *
-        * @param $text String: the text to tidy
-        * @return String
+        * @param string $text The text to tidy
+        * @return string
         */
        protected function tidy( $text ) {
                global $wgUseTidy;
@@ -891,6 +899,7 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Remove last character if it is a newline
+        * @param string $s
         */
        public function removeEndingNewline( $s ) {
                if ( substr( $s, -1 ) === "\n" ) {
@@ -972,9 +981,9 @@ class NewParserTest extends MediaWikiTestCase {
 
        /**
         * Use a regex to find out the value of an option
-        * @param $key String: name of option val to retrieve
-        * @param $opts Options array to look in
-        * @param $default Mixed: default value returned if not found
+        * @param string $key Name of option val to retrieve
+        * @param array $opts Options array to look in
+        * @param mixed $default Default value returned if not found
         */
        protected static function getOptionValue( $key, $opts, $default ) {
                $key = strtolower( $key );
index ff360e9..b0c0f1b 100644 (file)
@@ -100,9 +100,9 @@ class SearchEngineTest extends MediaWikiLangTestCase {
        /**
         * Insert a new page
         *
-        * @param $pageName String: page name
-        * @param $text String: page's content
-        * @param $n Integer: unused
+        * @param string $pageName Page name
+        * @param string $text Page's content
+        * @param int $ns Unused
         */
        protected function insertPage( $pageName, $text, $ns ) {
                $title = Title::newFromText( $pageName, $ns );
index 4ccf5d7..0fbb059 100644 (file)
@@ -13,10 +13,10 @@ class SpecialSearchTest extends MediaWikiTestCase {
        /**
         * @covers SpecialSearch::load
         * @dataProvider provideSearchOptionsTests
-        * @param $requested Array Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options.
-        * @param $userOptions Array User options to test with. For example array('searchNs5' => 1 );. NULL to use default options.
-        * @param $expectedProfile An expected search profile name
-        * @param $expectedNs Array Expected namespaces
+        * @param array $requested Request parameters. For example array( 'ns5' => true, 'ns6' => true). NULL to use default options.
+        * @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
         */
        public function testProfileAndNamespaceLoading(
                $requested, $userOptions, $expectedProfile, $expectedNS,
index e4f9396..ac3e41e 100644 (file)
@@ -356,10 +356,10 @@ class MediaWikiTitleCodecTest extends MediaWikiTestCase {
        /**
         * @dataProvider provideGetNamespaceName
         *
-        * @param $namespace
-        * @param $text
-        * @param $lang
-        * @param $expected
+        * @param int $namespace
+        * @param string $text
+        * @param string $lang
+        * @param string $expected
         *
         * @internal param \TitleValue $title
         */
index da72a9d..fdd40b2 100644 (file)
@@ -7,7 +7,7 @@
  */
 class UploadStashTest extends MediaWikiTestCase {
        /**
-        * @var Array of UploadStashTestUser
+        * @var array Array of UploadStashTestUser
         */
        public static $users;
 
index 8d35f36..bfb199f 100644 (file)
@@ -180,9 +180,9 @@ class LanguageSrTest extends LanguageClassesTestCase {
        ##### HELPERS #####################################################
        /**
         *Wrapper to verify text stay the same after applying conversion
-        * @param $text string Text to convert
-        * @param $variant string Language variant 'sr-ec' or 'sr-el'
-        * @param $msg string Optional message
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'sr-ec' or 'sr-el'
+        * @param string $msg Optional message
         */
        protected function assertUnConverted( $text, $variant, $msg = '' ) {
                $this->assertEquals(
@@ -194,9 +194,9 @@ class LanguageSrTest extends LanguageClassesTestCase {
 
        /**
         * Wrapper to verify a text is different once converted to a variant.
-        * @param $text string Text to convert
-        * @param $variant string Language variant 'sr-ec' or 'sr-el'
-        * @param $msg string Optional message
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'sr-ec' or 'sr-el'
+        * @param string $msg Optional message
         */
        protected function assertConverted( $text, $variant, $msg = '' ) {
                $this->assertNotEquals(
@@ -210,6 +210,8 @@ class LanguageSrTest extends LanguageClassesTestCase {
         * Verifiy the given Cyrillic text is not converted when using
         * using the cyrillic variant and converted to Latin when using
         * the Latin variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
         */
        protected function assertCyrillic( $text, $msg = '' ) {
                $this->assertUnConverted( $text, 'sr-ec', $msg );
@@ -220,6 +222,8 @@ class LanguageSrTest extends LanguageClassesTestCase {
         * Verifiy the given Latin text is not converted when using
         * using the Latin variant and converted to Cyrillic when using
         * the Cyrillic variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
         */
        protected function assertLatin( $text, $msg = '' ) {
                $this->assertUnConverted( $text, 'sr-el', $msg );
index 8cd3a6a..4881103 100644 (file)
@@ -59,9 +59,9 @@ class LanguageUzTest extends LanguageClassesTestCase {
        ##### HELPERS #####################################################
        /**
         * Wrapper to verify text stay the same after applying conversion
-        * @param $text string Text to convert
-        * @param $variant string Language variant 'uz-cyrl' or 'uz-latn'
-        * @param $msg string Optional message
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
+        * @param string $msg Optional message
         */
        protected function assertUnConverted( $text, $variant, $msg = '' ) {
                $this->assertEquals(
@@ -73,9 +73,9 @@ class LanguageUzTest extends LanguageClassesTestCase {
 
        /**
         * Wrapper to verify a text is different once converted to a variant.
-        * @param $text string Text to convert
-        * @param $variant string Language variant 'uz-cyrl' or 'uz-latn'
-        * @param $msg string Optional message
+        * @param string $text Text to convert
+        * @param string $variant Language variant 'uz-cyrl' or 'uz-latn'
+        * @param string $msg Optional message
         */
        protected function assertConverted( $text, $variant, $msg = '' ) {
                $this->assertNotEquals(
@@ -89,6 +89,8 @@ class LanguageUzTest extends LanguageClassesTestCase {
         * Verifiy the given Cyrillic text is not converted when using
         * using the cyrillic variant and converted to Latin when using
         * the Latin variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
         */
        protected function assertCyrillic( $text, $msg = '' ) {
                $this->assertUnConverted( $text, 'uz-cyrl', $msg );
@@ -99,6 +101,8 @@ class LanguageUzTest extends LanguageClassesTestCase {
         * Verifiy the given Latin text is not converted when using
         * using the Latin variant and converted to Cyrillic when using
         * the Cyrillic variant.
+        * @param string $text Text to convert
+        * @param string $msg Optional message
         */
        protected function assertLatin( $text, $msg = '' ) {
                $this->assertUnConverted( $text, 'uz-latn', $msg );
index 6950fa3..7d193f8 100644 (file)
@@ -28,9 +28,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        /**
         * Adds a revision to a page, while returning the resuting revision's id
         *
-        * @param $page WikiPage: page to add the revision to
-        * @param $text string: revisions text
-        * @param $text string: revisions summare
+        * @param Page $page Page to add the revision to
+        * @param string $text Revisions text
+        * @param string $text Revisions summare
         *
         * @throws MWExcepion
         */
@@ -51,8 +51,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        /**
         * gunzips the given file and stores the result in the original file name
         *
-        * @param $fname string: filename to read the gzipped data from and stored
-        *             the gunzipped data into
+        * @param string $fname Filename to read the gzipped data from and stored
+        *   the gunzipped data into
         */
        protected function gunzip( $fname ) {
                $gzipped_contents = file_get_contents( $fname );
@@ -112,10 +112,10 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        /**
         * Step the current XML reader until node end of given name is found.
         *
-        * @param $name string: name of the closing element to look for
-        *           (e.g.: "mediawiki" when looking for </mediawiki>)
+        * @param string $name Name of the closing element to look for
+        *   (e.g.: "mediawiki" when looking for </mediawiki>)
         *
-        * @return bool: true if the end node could be found. false otherwise.
+        * @return bool True if the end node could be found. false otherwise.
         */
        protected function skipToNodeEnd( $name ) {
                while ( $this->xml->read() ) {
@@ -133,11 +133,11 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Step the current XML reader to the first element start after the node
         * end of a given name.
         *
-        * @param $name string: name of the closing element to look for
-        *           (e.g.: "mediawiki" when looking for </mediawiki>)
+        * @param string $name Name of the closing element to look for
+        *   (e.g.: "mediawiki" when looking for </mediawiki>)
         *
-        * @return bool: true iff new element after the closing of $name could be
-        *           found. false otherwise.
+        * @return bool True if new element after the closing of $name could be
+        *   found. false otherwise.
         */
        protected function skipPastNodeEnd( $name ) {
                $this->assertTrue( $this->skipToNodeEnd( $name ),
@@ -154,9 +154,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
        /**
         * Opens an XML file to analyze and optionally skips past siteinfo.
         *
-        * @param $fname string: name of file to analyze
-        * @param $skip_siteinfo bool: (optional) If true, step the xml reader
-        *           to the first element after </siteinfo>
+        * @param string $fname Name of file to analyze
+        * @param bool $skip_siteinfo (optional) If true, step the xml reader
+        *   to the first element after </siteinfo>
         */
        protected function assertDumpStart( $fname, $skip_siteinfo = true ) {
                $this->xml = new XMLReader();
@@ -172,8 +172,8 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Asserts that the xml reader is at the final closing tag of an xml file and
         * closes the reader.
         *
-        * @param $tag string: (optional) the name of the final tag
-        *           (e.g.: "mediawiki" for </mediawiki>)
+        * @param string $tag (optional) the name of the final tag
+        *   (e.g.: "mediawiki" for </mediawiki>)
         */
        protected function assertDumpEnd( $name = "mediawiki" ) {
                $this->assertNodeEnd( $name, false );
@@ -200,9 +200,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Asserts that the xml reader is at an element of given name, and optionally
         * skips past it.
         *
-        * @param $name string: the name of the element to check for
-        *           (e.g.: "mediawiki" for <mediawiki>)
-        * @param $skip bool: (optional) if true, skip past the found element
+        * @param string $name The name of the element to check for
+        *   (e.g.: "mediawiki" for <mediawiki>)
+        * @param bool $skip (optional) if true, skip past the found element
         */
        protected function assertNodeStart( $name, $skip = true ) {
                $this->assertEquals( $name, $this->xml->name, "Node name" );
@@ -216,9 +216,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Asserts that the xml reader is at an closing element of given name, and optionally
         * skips past it.
         *
-        * @param $name string: the name of the closing element to check for
-        *           (e.g.: "mediawiki" for </mediawiki>)
-        * @param $skip bool: (optional) if true, skip past the found element
+        * @param string $name The name of the closing element to check for
+        *   (e.g.: "mediawiki" for </mediawiki>)
+        * @param bool $skip (optional) if true, skip past the found element
         */
        protected function assertNodeEnd( $name, $skip = true ) {
                $this->assertEquals( $name, $this->xml->name, "Node name" );
@@ -232,12 +232,12 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Asserts that the xml reader is at an element of given tag that contains a given text,
         * and skips over the element.
         *
-        * @param $name string: the name of the element to check for
-        *           (e.g.: "mediawiki" for <mediawiki>...</mediawiki>)
-        * @param $text string|false: If string, check if it equals the elements text.
-        *           If false, ignore the element's text
-        * @param $skip_ws bool: (optional) if true, skip past white spaces that trail the
-        *           closing element.
+        * @param string $name The name of the element to check for
+        *   (e.g.: "mediawiki" for <mediawiki>...</mediawiki>)
+        * @param string|false $text If string, check if it equals the elements text.
+        *   If false, ignore the element's text
+        * @param bool $skip_ws (optional) if true, skip past white spaces that trail the
+        *   closing element.
         */
        protected function assertTextNode( $name, $text, $skip_ws = true ) {
                $this->assertNodeStart( $name );
@@ -261,9 +261,9 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * title, ns, and id tags. Hence after this function, the xml reader is at the first
         * revision of the current page.
         *
-        * @param $id int: id of the page to assert
-        * @param $ns int: number of namespage to assert
-        * @param $name string: title of the current page
+        * @param int $id Id of the page to assert
+        * @param int $ns Number of namespage to assert
+        * @param string $name Title of the current page
         */
        protected function assertPageStart( $id, $ns, $name ) {
 
@@ -288,16 +288,16 @@ abstract class DumpTestCase extends MediaWikiLangTestCase {
         * Asserts that the xml reader is at a revision and checks its representation before
         * skipping over it.
         *
-        * @param $id int: id of the revision
-        * @param $summary string: summary of the revision
-        * @param $text_id int: id of the revision's text
-        * @param $text_bytes int: # of bytes in the revision's text
-        * @param $text_sha1 string: the base36 SHA-1 of the revision's text
-        * @param $text string|false: (optional) The revision's string, or false to check for a
+        * @param int $id Id of the revision
+        * @param string $summary Summary of the revision
+        * @param int $text_id Id of the revision's text
+        * @param int $text_bytes Number of bytes in the revision's text
+        * @param string $text_sha1 The base36 SHA-1 of the revision's text
+        * @param string|bool $text (optional) The revision's string, or false to check for a
         *            revision stub
-        * @param $model String: the expected content model id (default: CONTENT_MODEL_WIKITEXT)
-        * @param $format String: the expected format model id (default: CONTENT_FORMAT_WIKITEXT)
-        * @param $parentid int|false: (optional) id of the parent revision
+        * @param string $model The expected content model id (default: CONTENT_MODEL_WIKITEXT)
+        * @param string $format The expected format model id (default: CONTENT_FORMAT_WIKITEXT)
+        * @param int|bool $parentid (optional) id of the parent revision
         */
        protected function assertRevision( $id, $summary, $text_id, $text_bytes, $text_sha1, $text = false, $parentid = false,
                $model = CONTENT_MODEL_WIKITEXT, $format = CONTENT_FORMAT_WIKITEXT
index 2a5bd5f..42d1d0b 100644 (file)
@@ -158,12 +158,12 @@ class MaintenanceTest extends MediaWikiTestCase {
         *
         * This function simulates shutdown of self::m.
         *
-        * @param $preShutdownOutput string: expected output before simulating shutdown
-        * @param $expectNLAppending bool: Whether or not shutdown simulation is expected
-        *            to add a newline to the output. If false, $preShutdownOutput is the
-        *            expected output after shutdown simulation. Otherwise,
-        *            $preShutdownOutput with an appended newline is the expected output
-        *            after shutdown simulation.
+        * @param string $preShutdownOutput Expected output before simulating shutdown
+        * @param bool $expectNLAppending Whether or not shutdown simulation is expected
+        *   to add a newline to the output. If false, $preShutdownOutput is the
+        *   expected output after shutdown simulation. Otherwise,
+        *   $preShutdownOutput with an appended newline is the expected output
+        *   after shutdown simulation.
         */
        private function assertOutputPrePostShutdown( $preShutdownOutput, $expectNLAppending ) {
 
index adf026c..904f12f 100644 (file)
@@ -30,9 +30,9 @@ class BaseDumpTest extends MediaWikiTestCase {
        /**
         * asserts that a prefetch yields an expected string
         *
-        * @param $expected string|null: the exepcted result of the prefetch
-        * @param $page int: the page number to prefetch the text for
-        * @param $revision int: the revision number to prefetch the text for
+        * @param string|null $expected The exepcted result of the prefetch
+        * @param int $page The page number to prefetch the text for
+        * @param int $revision The revision number to prefetch the text for
         */
        private function assertPrefetchEquals( $expected, $page, $revision ) {
                $this->assertEquals( $expected, $this->dump->prefetch( $page, $revision ),
@@ -142,9 +142,9 @@ class BaseDumpTest extends MediaWikiTestCase {
         *
         * The temporary file is removed by DumpBackup upon tearDown.
         *
-        * @param $requested_pages Array The indices of the page parts that should
-        *             go into the prefetch file. 1,2,4 are available.
-        * @return String The file name of the created temporary file
+        * @param array $requested_pages The indices of the page parts that should
+        *    go into the prefetch file. 1,2,4 are available.
+        * @return string The file name of the created temporary file
         */
        private function setUpPrefetch( $requested_pages = array( 1, 2, 4 ) ) {
                // The file name, where we store the prepared prefetch file
index 8a297b1..a763071 100644 (file)
@@ -219,8 +219,8 @@ class TextPassDumperTest extends DumpTestCase {
         * Ensures that checkpoint dumps are used and written, by successively increasing the
         * stub size and dumping until the duration crosses a threshold.
         *
-        * @param $checkpointFormat string: Either "file" for plain text or "gzip" for gzipped
-        *                checkpoint files.
+        * @param string $checkpointFormat Either "file" for plain text or "gzip" for gzipped
+        *   checkpoint files.
         */
        private function checkpointHelper( $checkpointFormat = "file" ) {
                // Getting temporary names
@@ -421,16 +421,14 @@ class TextPassDumperTest extends DumpTestCase {
        /**
         * Creates a stub file that is used for testing the text pass of dumps
         *
-        * @param $fname string: (Optional) Absolute name of the file to write
-        *           the stub into. If this parameter is null, a new temporary
-        *           file is generated that is automatically removed upon
-        *           tearDown.
-        * @param $iterations integer: (Optional) specifies how often the block
-        *           of 3 pages should go into the stub file. The page and
-        *           revision id increase further and further, while the text
-        *           id of the first iteration is reused. The pages and revision
-        *           of iteration > 1 have no corresponding representation in the
-        *           database.
+        * @param string $fname (Optional) Absolute name of the file to write
+        *   the stub into. If this parameter is null, a new temporary
+        *   file is generated that is automatically removed upon tearDown.
+        * @param int $iterations (Optional) specifies how often the block
+        *   of 3 pages should go into the stub file. The page and
+        *   revision id increase further and further, while the text
+        *   id of the first iteration is reused. The pages and revision
+        *   of iteration > 1 have no corresponding representation in the database.
         * @return string absolute filename of the stub
         */
        private function setUpStub( $fname = null, $iterations = 1 ) {
index 5640b8d..7ca4596 100644 (file)
@@ -16,16 +16,15 @@ class BackupDumperLoggerTest extends DumpTestCase {
        /**
         * adds a log entry to the database.
         *
-        * @param $type string: type of the log entry
-        * @param $subtype string: subtype of the log entry
-        * @param $user User: user that performs the logged operation
-        * @param $ns int: number of the namespace for the entry's target's title
-        * @param $title string: title of the entry's target
-        * @param $comment string: comment of the log entry
-        * @param $parameters Array: (optional) accompanying data that is attached
-        *               to the entry
+        * @param string $type Type of the log entry
+        * @param string $subtype Subtype of the log entry
+        * @param User $user User that performs the logged operation
+        * @param int $ns Number of the namespace for the entry's target's title
+        * @param string $title Title of the entry's target
+        * @param string $comment Comment of the log entry
+        * @param array $parameters (optional) accompanying data that is attached to the entry
         *
-        * @return int id of the added log entry
+        * @return int Id of the added log entry
         */
        private function addLogEntry( $type, $subtype, User $user, $ns, $title,
                $comment = null, $parameters = null
@@ -88,15 +87,14 @@ class BackupDumperLoggerTest extends DumpTestCase {
         * asserts that the xml reader is at the beginning of a log entry and skips over
         * it while analyzing it.
         *
-        * @param $id int: id of the log entry
-        * @param $user_name string: user name of the log entry's performer
-        * @param $user_id int: user id of the log entry 's performer
-        * @param $comment string|null: comment of the log entry. If null, the comment
-        *             text is ignored.
-        * @param $type string: type of the log entry
-        * @param $subtype string: subtype of the log entry
-        * @param $title string: title of the log entry's target
-        * @param $parameters array: (optional) unserialized data accompanying the log entry
+        * @param int $id Id of the log entry
+        * @param string $user_name User name of the log entry's performer
+        * @param int $user_id User id of the log entry 's performer
+        * @param string|null $comment Comment of the log entry. If null, the comment text is ignored.
+        * @param string $type Type of the log entry
+        * @param string $subtype Subtype of the log entry
+        * @param string $title Title of the log entry's target
+        * @param array $parameters (optional) unserialized data accompanying the log entry
         */
        private function assertLogItem( $id, $user_name, $user_id, $comment, $type,
                $subtype, $title, $parameters = array()
index dd80840..2e47e0c 100644 (file)
@@ -11,7 +11,7 @@ require_once __DIR__ . "/../../../maintenance/fetchText.php";
 class SemiMockedFetchText extends FetchText {
 
        /**
-        * @var String|null Text to pass as stdin
+        * @var string|null Text to pass as stdin
         */
        private $mockStdinText = null;
 
@@ -21,14 +21,14 @@ class SemiMockedFetchText extends FetchText {
        private $mockSetUp = false;
 
        /**
-        * @var Array Invocation counters for the mocked aspects
+        * @var array Invocation counters for the mocked aspects
         */
        private $mockInvocations = array( 'getStdin' => 0 );
 
        /**
         * Data for the fake stdin
         *
-        * @param $stdin String The string to be used instead of stdin
+        * @param string $stdin The string to be used instead of stdin
         */
        function mockStdin( $stdin ) {
                $this->mockStdinText = $stdin;
@@ -38,7 +38,7 @@ class SemiMockedFetchText extends FetchText {
        /**
         * Gets invocation counters for mocked methods.
         *
-        * @return Array An array, whose keys are function names. The corresponding values
+        * @return array An array, whose keys are function names. The corresponding values
         * denote the number of times the function has been invoked.
         */
        function mockGetInvocations() {
@@ -98,9 +98,9 @@ class FetchTextTest extends MediaWikiTestCase {
        /**
         * Adds a revision to a page, while returning the resuting text's id
         *
-        * @param $page WikiPage The page to add the revision to
-        * @param $text String The revisions text
-        * @param $text String The revisions summare
+        * @param WikiPage $page The page to add the revision to
+        * @param string $text The revisions text
+        * @param string $text The revisions summare
         *
         * @throws MWExcepion
         */
@@ -155,6 +155,8 @@ class FetchTextTest extends MediaWikiTestCase {
 
        /**
         * Helper to relate FetchText's input and output
+        * @param string $input
+        * @param string $expectedOutput
         */
        private function assertFilter( $input, $expectedOutput ) {
                $this->fetchText->mockStdin( $input );
index bb678af..165dc55 100644 (file)
@@ -16,7 +16,7 @@ class GetSlaveServerTest extends MediaWikiTestCase {
         * It matches IPs or hostnames, both optionally followed by a
         * port specification
         *
-        * @return String the regular expression
+        * @return string The regular expression
         */
        private function getServerRE() {
                if ( $this->db->getType() === 'sqlite' ) {
index 3fb487c..a3122b9 100644 (file)
@@ -48,9 +48,9 @@ class SideBarTest extends MediaWikiLangTestCase {
 
        /**
         * Internal helper to test the sidebar
-        * @param $expected
-        * @param $text
-        * @param $message (Default: '')
+        * @param array $expected
+        * @param string $text
+        * @param string $message (Default: '')
         * @todo this assert method to should be converted to a test using a dataprovider..
         */
        private function assertSideBar( $expected, $text, $message = '' ) {
index fb7780d..4bc29cd 100644 (file)
@@ -137,7 +137,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        /**
         * Delete the specified files, if they exist.
         *
-        * @param $files Array: full paths to files to delete.
+        * @param array $files Full paths to files to delete.
         */
        private static function deleteFiles( $files ) {
                foreach ( $files as $file ) {
@@ -150,7 +150,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
        /**
         * Delete the specified directories, if they exist. Must be empty.
         *
-        * @param $dirs Array: full paths to directories to delete.
+        * @param array $dirs Full paths to directories to delete.
         */
        private static function deleteDirs( $dirs ) {
                foreach ( $dirs as $dir ) {
@@ -164,7 +164,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite {
         * Create a dummy uploads directory which will contain a couple
         * of files in order to pass existence tests.
         *
-        * @return String: the directory
+        * @return string The directory
         */
        private function setupUploadDir() {
                global $IP;
index bc67147..6ff2b24 100644 (file)
@@ -333,8 +333,8 @@ class DbTestRecorder extends DbTestPreviewer {
        /**
         * Record an individual test item's success or failure to the db
         *
-        * @param $test String
-        * @param $result Boolean
+        * @param string $test
+        * @param bool $result
         */
        function record( $test, $result ) {
                parent::record( $test, $result );
@@ -545,9 +545,9 @@ class TestFileIterator implements Iterator {
         * Throw an exception if it is not set, referencing current section
         * and adding the current file name and line number
         *
-        * @param $token String|Array: expected token(s) that should have been
+        * @param string|array $token Expected token(s) that should have been
         * mentioned before closing this section
-        * @param $fatal Boolean: true iff an exception should be thrown if
+        * @param bool $fatal True iff an exception should be thrown if
         * the section is not found.
         */
        private function checkSection( $tokens, $fatal = true ) {
@@ -618,6 +618,7 @@ class DelayedParserTest {
        /**
         * Called whenever we actually want to run the hook.
         * Should be the case if we found the parserTest is not disabled
+        * @param ParserTest|NewParserTest $parserTest
         */
        public function unleash( &$parserTest ) {
                if ( !( $parserTest instanceof ParserTest || $parserTest instanceof NewParserTest )     ) {
@@ -647,6 +648,7 @@ class DelayedParserTest {
        /**
         * Similar to ParserTest object but does not run anything
         * Use unleash() to really execute the hook
+        * @param string $hook
         */
        public function requireHook( $hook ) {
                $this->hooks[] = $hook;
@@ -655,6 +657,7 @@ class DelayedParserTest {
        /**
         * Similar to ParserTest object but does not run anything
         * Use unleash() to really execute the hook function
+        * @param string $fnHook
         */
        public function requireFunctionHook( $fnHook ) {
                $this->fnHooks[] = $fnHook;