From 2aa67db39dfb56318aac9d41a763e19a5ae28839 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thiemo=20M=C3=A4ttig?= Date: Wed, 9 Apr 2014 12:33:55 +0200 Subject: [PATCH] Fix "@param null $param" documentations ... and very few other documentation details that are closely connected to these mistakes. Change-Id: I5b2691948e196124c77f0cc04d0ed5a7167cac25 --- includes/filerepo/ForeignAPIRepo.php | 3 ++- includes/installer/DatabaseUpdater.php | 5 +++-- includes/parser/CoreParserFunctions.php | 9 +++++---- includes/parser/DateFormatter.php | 3 ++- tests/phpunit/includes/RevisionTest.php | 2 +- .../includes/content/ContentHandlerTest.php | 20 ++++++++++--------- 6 files changed, 24 insertions(+), 18 deletions(-) diff --git a/includes/filerepo/ForeignAPIRepo.php b/includes/filerepo/ForeignAPIRepo.php index 4e48932a19..35ac60f5b1 100644 --- a/includes/filerepo/ForeignAPIRepo.php +++ b/includes/filerepo/ForeignAPIRepo.php @@ -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 = '' ) { diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index 3f2e2cb8f8..5223cd3319 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -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 ) { diff --git a/includes/parser/CoreParserFunctions.php b/includes/parser/CoreParserFunctions.php index 8fa39fa648..02f2438e8a 100644 --- a/includes/parser/CoreParserFunctions.php +++ b/includes/parser/CoreParserFunctions.php @@ -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(); diff --git a/includes/parser/DateFormatter.php b/includes/parser/DateFormatter.php index 0a69b04518..d10841f4f8 100644 --- a/includes/parser/DateFormatter.php +++ b/includes/parser/DateFormatter.php @@ -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 ); diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php index fc23919576..48a4017ad7 100644 --- a/tests/phpunit/includes/RevisionTest.php +++ b/tests/phpunit/includes/RevisionTest.php @@ -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 */ diff --git a/tests/phpunit/includes/content/ContentHandlerTest.php b/tests/phpunit/includes/content/ContentHandlerTest.php index d1c214aeac..080ff545fa 100644 --- a/tests/phpunit/includes/content/ContentHandlerTest.php +++ b/tests/phpunit/includes/content/ContentHandlerTest.php @@ -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 -- 2.20.1