Fix "@param null $param" documentations
authorThiemo Mättig <thiemo.maettig@wikimedia.de>
Wed, 9 Apr 2014 10:33:55 +0000 (12:33 +0200)
committerThiemo Mättig <thiemo.maettig@wikimedia.de>
Wed, 9 Apr 2014 10:33:55 +0000 (12:33 +0200)
... and very few other documentation details that are closely connected
to these mistakes.

Change-Id: I5b2691948e196124c77f0cc04d0ed5a7167cac25

includes/filerepo/ForeignAPIRepo.php
includes/installer/DatabaseUpdater.php
includes/parser/CoreParserFunctions.php
includes/parser/DateFormatter.php
tests/phpunit/includes/RevisionTest.php
tests/phpunit/includes/content/ContentHandlerTest.php

index 4e48932..35ac60f 100644 (file)
@@ -252,8 +252,9 @@ class ForeignAPIRepo extends FileRepo {
         * @param string $name
         * @param int $width
         * @param int $height
-        * @param null $result
+        * @param array $result Out parameter that will be changed by the function.
         * @param string $otherParams
+        *
         * @return bool
         */
        function getThumbUrl( $name, $width = -1, $height = -1, &$result = null, $otherParams = '' ) {
index 3f2e2cb..5223cd3 100644 (file)
@@ -155,10 +155,11 @@ abstract class DatabaseUpdater {
        }
 
        /**
-        * @throws MWException
         * @param DatabaseBase $db
         * @param bool $shared
-        * @param null $maintenance
+        * @param Maintenance $maintenance
+        *
+        * @throws MWException
         * @return DatabaseUpdater
         */
        public static function newForDB( &$db, $shared = false, $maintenance = null ) {
index 8fa39fa..02f2438 100644 (file)
@@ -91,10 +91,11 @@ class CoreParserFunctions {
        }
 
        /**
-        * @param $parser Parser
-        * @param $date
-        * @param null $defaultPref
-        * @return mixed|string
+        * @param Parser $parser
+        * @param string $date
+        * @param string $defaultPref
+        *
+        * @return string
         */
        static function formatDate( $parser, $date, $defaultPref = null ) {
                $lang = $parser->getFunctionLang();
index 0a69b04..d10841f 100644 (file)
@@ -143,7 +143,8 @@ class DateFormatter {
         * @param string $preference User preference
         * @param string $text Text to reformat
         * @param array $options can contain 'linked' and/or 'match-whole'
-        * @return mixed|String
+        *
+        * @return string
         */
        function reformat( $preference, $text, $options = array( 'linked' ) ) {
                $linked = in_array( 'linked', $options );
index fc23919..48a4017 100644 (file)
@@ -179,7 +179,7 @@ class RevisionTest extends MediaWikiTestCase {
         * @param string $text
         * @param string $title
         * @param string $model
-        * @param null $format
+        * @param string $format
         *
         * @return Revision
         */
index d1c214a..080ff54 100644 (file)
@@ -315,22 +315,24 @@ class DummyContentHandlerForTesting extends ContentHandler {
        }
 
        /**
-        * Serializes Content object of the type supported by this ContentHandler.
+        * @see ContentHandler::serializeContent
         *
-        * @param Content $content the Content object to serialize
-        * @param null $format the desired serialization format
-        * @return String serialized form of the content
+        * @param Content $content
+        * @param string $format
+        *
+        * @return string
         */
        public function serializeContent( Content $content, $format = null ) {
                return $content->serialize();
        }
 
        /**
-        * Unserializes a Content object of the type supported by this ContentHandler.
+        * @see ContentHandler::unserializeContent
+        *
+        * @param string $blob
+        * @param string $format Unused.
         *
-        * @param $blob String serialized form of the content
-        * @param null $format the format used for serialization
-        * @return Content the Content object created by deserializing $blob
+        * @return Content
         */
        public function unserializeContent( $blob, $format = null ) {
                $d = unserialize( $blob );
@@ -437,7 +439,7 @@ class DummyContentForTesting extends AbstractContent {
 
        /**
         * @param Title $title
-        * @param null $revId
+        * @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