Change @return to start with type
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 13 Aug 2014 17:54:49 +0000 (19:54 +0200)
committerumherirrender <umherirrender_de.wp@web.de>
Wed, 20 Aug 2014 18:35:41 +0000 (20:35 +0200)
MediaWiki default is "@return type Description", so set a type after
return and start the description with a capital letter. Also use the
more common spelling of boolean.

See http://phpdoc.org/docs/latest/references/phpdoc/tags/return.html for
more about @return

Change-Id: I4e5198822fe92836f9cef9918a9fc1a1a1e0a043

17 files changed:
includes/db/DatabaseUtility.php
includes/skins/Skin.php
includes/skins/SkinFactory.php
languages/Language.php
maintenance/findHooks.php
maintenance/sqlite.inc
tests/parser/parserTest.inc
tests/phpunit/includes/StatusTest.php
tests/phpunit/includes/api/ApiTestCase.php
tests/phpunit/includes/api/RandomImageGenerator.php
tests/phpunit/includes/api/query/ApiQueryContinueTestBase.php
tests/phpunit/includes/content/ContentHandlerTest.php
tests/phpunit/includes/db/ORMRowTest.php
tests/phpunit/includes/diff/DifferenceEngineTest.php
tests/phpunit/includes/media/MediaWikiMediaTestCase.php
tests/phpunit/languages/LanguageTest.php
tests/phpunit/maintenance/backupTextPassTest.php

index 7ec3b4a..c1e80d3 100644 (file)
@@ -192,7 +192,7 @@ class ResultWrapper implements Iterator {
        }
 
        /**
-        * @return stdClass|array|false
+        * @return stdClass|array|bool
         */
        function current() {
                if ( is_null( $this->currentRow ) ) {
@@ -281,7 +281,7 @@ class FakeResultWrapper extends ResultWrapper {
 
        /**
         * Callers want to be able to access fields with $this->fieldName
-        * @return false|stdClass
+        * @return bool|stdClass
         */
        function fetchObject() {
                $this->fetchRow();
@@ -298,7 +298,7 @@ class FakeResultWrapper extends ResultWrapper {
        }
 
        /**
-        * @return false|stdClass
+        * @return bool|stdClass
         */
        function next() {
                return $this->fetchObject();
index 3750bad..dc06eba 100644 (file)
@@ -417,7 +417,7 @@ abstract class Skin extends ContextSource {
 
        /**
         * Return values for <html> element
-        * @return array of associative name-to-value elements for <html> element
+        * @return array Array of associative name-to-value elements for <html> element
         */
        public function getHtmlElementAttributes() {
                $lang = $this->getLanguage();
index 0935e33..6448088 100644 (file)
@@ -159,7 +159,7 @@ class SkinFactory {
         * Get a legacy skin which uses the autodiscovery mechanism.
         *
         * @param string $name
-        * @return Skin|bool false if the skin couldn't be constructed
+        * @return Skin|bool False if the skin couldn't be constructed
         */
        private function getLegacySkin( $name ) {
                $skinNames = $this->getLegacySkinNames();
index 8440bd4..68b3123 100644 (file)
@@ -3997,7 +3997,7 @@ class Language {
         * Get the list of variants supported by this language
         * see sample implementation in LanguageZh.php
         *
-        * @return array an array of language codes
+        * @return array An array of language codes
         */
        public function getVariants() {
                return $this->mConverter->getVariants();
@@ -4289,7 +4289,7 @@ class Language {
         *
         * @since 1.22
         * @param string $code Language code
-        * @return array array( fallbacks, site fallbacks )
+        * @return array Array( fallbacks, site fallbacks )
         */
        public static function getFallbacksIncludingSiteLanguage( $code ) {
                global $wgLanguageCode;
@@ -4344,7 +4344,7 @@ class Language {
         *
         * @since 1.19
         * @param string $code Language code
-        * @return array of message keys (strings)
+        * @return array Array of message keys (strings)
         */
        public static function getMessageKeysFor( $code ) {
                return self::getLocalisationCache()->getSubItemList( $code, 'messages' );
index d40fec6..17b9a04 100644 (file)
@@ -137,7 +137,7 @@ class FindHooks extends Maintenance {
        /**
         * Get the hook documentation, either locally or from MediaWiki.org
         * @param string $doc
-        * @return Array of documented hooks
+        * @return array Array of documented hooks
         */
        private function getHooksFromDoc( $doc ) {
                if ( $this->hasOption( 'online' ) ) {
@@ -150,7 +150,7 @@ class FindHooks extends Maintenance {
        /**
         * Get hooks from a local file (for example docs/hooks.txt)
         * @param string $doc Filename to look in
-        * @return Array of documented hooks
+        * @return array Array of documented hooks
         */
        private function getHooksFromLocalDoc( $doc ) {
                $m = array();
@@ -162,7 +162,7 @@ class FindHooks extends Maintenance {
 
        /**
         * Get hooks from www.mediawiki.org using the API
-        * @return Array of documented hooks
+        * @return array Array of documented hooks
         */
        private function getHooksFromOnlineDoc() {
                // All hooks
@@ -200,7 +200,7 @@ class FindHooks extends Maintenance {
        /**
         * Get hooks from a PHP file
         * @param string $file Full filename to the PHP file.
-        * @return Array of hooks found.
+        * @return array Array of hooks found
         */
        private function getHooksFromFile( $file ) {
                $content = file_get_contents( $file );
@@ -217,7 +217,7 @@ class FindHooks extends Maintenance {
        /**
         * Get hooks from the source code.
         * @param string $path Directory where the include files can be found
-        * @return Array of hooks found.
+        * @return array Array of hooks found
         */
        private function getHooksFromPath( $path ) {
                $hooks = array();
@@ -237,7 +237,7 @@ class FindHooks extends Maintenance {
        /**
         * Get bad hooks (where the hook name could not be determined) from a PHP file
         * @param string $file Full filename to the PHP file.
-        * @return Array of bad wfRunHooks() lines
+        * @return array Array of bad wfRunHooks() lines
         */
        private function getBadHooksFromFile( $file ) {
                $content = file_get_contents( $file );
@@ -255,7 +255,7 @@ class FindHooks extends Maintenance {
        /**
         * Get bad hooks from the source code.
         * @param string $path Directory where the include files can be found
-        * @return Array of bad wfRunHooks() lines
+        * @return array Array of bad wfRunHooks() lines
         */
        private function getBadHooksFromPath( $path ) {
                $hooks = array();
index 43b2598..5c0fd07 100644 (file)
@@ -42,7 +42,7 @@ class Sqlite {
         * Will throw exceptions on SQL errors
         * @param array|string $files
         * @throws MWException
-        * @return True if no error or error string in case of errors
+        * @return bool True if no error or error string in case of errors
         */
        public static function checkSqlSyntax( $files ) {
                if ( !Sqlite::isPresent() ) {
index 2c44150..a342fec 100644 (file)
@@ -1395,7 +1395,7 @@ class ParserTest {
        /**
         * Print a skipped message.
         *
-        * @return boolean
+        * @return bool
         */
        protected function showSkipped() {
                if ( $this->showProgress ) {
index 11f867a..628c59b 100644 (file)
@@ -320,7 +320,7 @@ class StatusTest extends MediaWikiLangTestCase {
        }
 
        /**
-        * @return array of arrays with values;
+        * @return array Array of arrays with values;
         *    0 => status object
         *    1 => expected string (with no context)
         */
@@ -391,7 +391,7 @@ class StatusTest extends MediaWikiLangTestCase {
        }
 
        /**
-        * @return array of arrays with values;
+        * @return array Array of arrays with values;
         *    0 => status object
         *    1 => expected Message parameters (with no context)
         *    2 => expected Message key
index f633315..cd14194 100644 (file)
@@ -47,7 +47,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
         * @param string $text Content of the page
         * @param string $summary Optional summary string for the revision
         * @param int $defaultNs Optional namespace id
-        * @return Array as returned by WikiPage::doEditContent()
+        * @return array Array as returned by WikiPage::doEditContent()
         */
        protected function editPage( $pageName, $text, $summary = '', $defaultNs = NS_MAIN ) {
                $title = Title::newFromText( $pageName, $defaultNs );
@@ -121,7 +121,7 @@ abstract class ApiTestCase extends MediaWikiLangTestCase {
         * @param array $params Key-value API params
         * @param array|null $session Session array
         * @param User|null $user A User object for the context
-        * @return Result of the API call
+        * @return array Result of the API call
         * @throws Exception In case wsToken is not set in the session
         */
        protected function doApiRequestWithToken( array $params, array $session = null,
index 328ea8e..6374cfa 100644 (file)
@@ -328,7 +328,7 @@ class RandomImageGenerator {
         * This is used when simulating a rotated image capture with Exif orientation
         * @param array $spec Returned by getImageSpec
         * @param array $matrix 2x2 transformation matrix
-        * @return array transformed Spec
+        * @return array Transformed Spec
         */
        private static function rotateImageSpec( &$spec, $matrix ) {
                $tSpec = array();
@@ -367,7 +367,7 @@ class RandomImageGenerator {
         * @param array $matrix 2x2 rotation matrix
         * @param int $x The x-coordinate number
         * @param int $y The y-coordinate number
-        * @return Transformed with properties x, y
+        * @return array Transformed with properties x, y
         */
        private static function matrixMultiply2x2( $matrix, $x, $y ) {
                return array(
@@ -432,7 +432,7 @@ class RandomImageGenerator {
         * array( array( 'foo', 'bar' ), array( 'quux', 'baz' ) );
         *
         * @param int $number Number of pairs
-        * @return array two-element arrays
+        * @return array Two-element arrays
         */
        private function getRandomWordPairs( $number ) {
                $lines = $this->getRandomLines( $number * 2 );
@@ -454,7 +454,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 d986e69..bce6268 100644 (file)
@@ -38,7 +38,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
         * @param int $expectedCount Max number of iterations
         * @param string $id Unit test id
         * @param bool $continue True to use smart continue
-        * @return Merged results data array
+        * @return array Merged results data array
         */
        protected function checkC( $expected, $params, $expectedCount, $id, $continue = true ) {
                $result = $this->query( $params, $expectedCount, $id, $continue );
@@ -51,7 +51,7 @@ abstract class ApiQueryContinueTestBase extends ApiQueryTestBase {
         * @param int $expectedCount Max number of iterations
         * @param string $id Unit test id
         * @param bool $useContinue True to use smart continue
-        * @return Merged results data array
+        * @return array Merged results data array
         * @throws Exception
         */
        protected function query( $params, $expectedCount, $id, $useContinue = true ) {
index 042ae93..f744973 100644 (file)
@@ -448,7 +448,7 @@ class DummyContentForTesting extends AbstractContent {
         * Returns native represenation of the data. Interpretation depends on the data model used,
         * as given by getDataModel().
         *
-        * @return mixed the native representation of the content. Could be a string, a nested array
+        * @return mixed The native representation of the content. Could be a string, a nested array
         *  structure, an object, a binary blob... anything, really.
         */
        public function getNativeData() {
@@ -476,7 +476,7 @@ class DummyContentForTesting extends AbstractContent {
         * return $this. That is,  $copy === $original may be true, but only for imutable content
         * objects.
         *
-        * @return Content. A copy of this object.
+        * @return Content A copy of this object
         */
        public function copy() {
                return $this;
index 4ff6165..447bf21 100644 (file)
@@ -115,7 +115,7 @@ abstract class ORMRowTest extends \MediaWikiTestCase {
 
        /**
         * @since 1.20
-        * @return array of IORMRow
+        * @return array Array of IORMRow
         */
        public function instanceProvider() {
                $instances = array();
index e1a69e3..5474b96 100644 (file)
@@ -39,7 +39,7 @@ class DifferenceEngineTest extends MediaWikiTestCase {
        }
 
        /**
-        * @return int[] revision ids
+        * @return int[] Revision ids
         */
        protected function doEdits() {
                $title = $this->getTitle();
index 8e56245..8f28158 100644 (file)
@@ -33,7 +33,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
        }
 
        /**
-        * @return Array Argument for FSRepo constructor
+        * @return array Argument for FSRepo constructor
         */
        protected function getRepoOptions() {
                return array(
@@ -47,7 +47,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
         * The result of this method will set the file path to use,
         * as well as the protected member $filePath
         *
-        * @return String path where files are
+        * @return string Path where files are
         */
        protected function getFilePath() {
                return __DIR__ . '/../../data/media/';
@@ -59,7 +59,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase {
         *
         * Override this method if your test case creates thumbnails
         *
-        * @return boolean
+        * @return bool
         */
        protected function createsThumbnails() {
                return false;
index ec51441..cff2e8f 100644 (file)
@@ -276,7 +276,7 @@ class LanguageTest extends LanguageClassesTestCase {
        }
 
        /**
-        * @return array format is ($len, $ellipsis, $input, $expected)
+        * @return array Format is ($len, $ellipsis, $input, $expected)
         */
        public static function provideHTMLTruncateData() {
                return array(
index 016b7e0..a37a97c 100644 (file)
@@ -434,7 +434,7 @@ class TextPassDumperTest extends DumpTestCase {
         *   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
+        * @return string Absolute filename of the stub
         */
        private function setUpStub( $fname = null, $iterations = 1 ) {
                if ( $fname === null ) {