From: Leszek Manicki Date: Wed, 14 Dec 2016 16:01:47 +0000 (+0100) Subject: Fix parameter type docs X-Git-Tag: 1.31.0-rc.0~4591^2 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=95b9d82a3a1813ec17fa078710dc2d89338afedb;p=lhc%2Fweb%2Fwiklou.git Fix parameter type docs Changes: - uses int instead of number as param and return value type, - uses stdClass instead of stdObject - fixes ResourceLoaderClientHtml constructor's $target param type: it is string|null, not an array (previously misspelled as "aray") - changes the type of references to XML parser in XMP lib to resource instead of not existing XMLParser Change-Id: I98c363ebc6658d1f4dcabad97a9a92f3fcd7ea8c --- diff --git a/includes/Message.php b/includes/Message.php index 9c0ab1ce28..2816aedeec 100644 --- a/includes/Message.php +++ b/includes/Message.php @@ -1054,9 +1054,9 @@ class Message implements MessageSpecifier, Serializable { /** * @since 1.22 * - * @param number $period + * @param int $period * - * @return number[] Array with a single "period" key. + * @return int[] Array with a single "period" key. */ public static function timeperiodParam( $period ) { return [ 'period' => $period ]; diff --git a/includes/content/Content.php b/includes/content/Content.php index 931128faed..6a0a63bfbd 100644 --- a/includes/content/Content.php +++ b/includes/content/Content.php @@ -381,7 +381,7 @@ interface Content { * * @since 1.21 * - * @param string|number $sectionId Section identifier as a number or string + * @param string|int $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'). The ID "0" retrieves the section before the first heading, "1" the * text between the first heading (included) and the second heading (excluded), etc. * @@ -396,7 +396,7 @@ interface Content { * * @since 1.21 * - * @param string|number|null|bool $sectionId Section identifier as a number or string + * @param string|int|null|bool $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page * or 'new' for a new section. * @param Content $with New content of the section diff --git a/includes/content/WikitextContent.php b/includes/content/WikitextContent.php index 92967282c4..d649baf89c 100644 --- a/includes/content/WikitextContent.php +++ b/includes/content/WikitextContent.php @@ -38,7 +38,7 @@ class WikitextContent extends TextContent { } /** - * @param string|number $sectionId + * @param string|int $sectionId * * @return Content|bool|null * @@ -58,7 +58,7 @@ class WikitextContent extends TextContent { } /** - * @param string|number|null|bool $sectionId + * @param string|int|null|bool $sectionId * @param Content $with * @param string $sectionTitle * diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php index d12af7a43c..a657a33f2c 100644 --- a/includes/libs/xmp/XMP.php +++ b/includes/libs/xmp/XMP.php @@ -491,7 +491,7 @@ class XMPReader implements LoggerAwareInterface { * 0/10 * and are processing the 0/10 bit. * - * @param XMLParser $parser XMLParser reference to the xml parser + * @param resource $parser XMLParser reference to the xml parser * @param string $data Character data * @throws RuntimeException On invalid data */ @@ -776,7 +776,7 @@ class XMPReader implements LoggerAwareInterface { * Ignores the outer wrapping elements that are optional in * xmp and have no meaning. * - * @param XMLParser $parser + * @param resource $parser * @param string $elm Namespace . ' ' . element name * @throws RuntimeException */ @@ -1188,7 +1188,7 @@ class XMPReader implements LoggerAwareInterface { * Generally just calls a helper based on what MODE we're in. * Also does some initial set up for the wrapper element * - * @param XMLParser $parser + * @param resource $parser * @param string $elm Namespace "" element * @param array $attribs Attribute name => value * @throws RuntimeException diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index 0bb47baa1b..1c11b4f89f 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -1405,7 +1405,7 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param string|number|null|bool $sectionId Section identifier as a number or string + * @param string|int|null|bool $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page * or 'new' for a new section. * @param Content $sectionContent New content of the section. @@ -1445,7 +1445,7 @@ class WikiPage implements Page, IDBAccessObject { } /** - * @param string|number|null|bool $sectionId Section identifier as a number or string + * @param string|int|null|bool $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'), null/false or an empty string for the whole page * or 'new' for a new section. * @param Content $sectionContent New content of the section. diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index 8c93669c13..741854749a 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -5437,7 +5437,7 @@ class Parser { * External callers should use the getSection and replaceSection methods. * * @param string $text Page wikitext - * @param string|number $sectionId A section identifier string of the form: + * @param string|int $sectionId A section identifier string of the form: * " - - ... -
" * * Currently the only recognised flag is "T", which means the target section number @@ -5578,7 +5578,7 @@ class Parser { * If a section contains subsections, these are also returned. * * @param string $text Text to look in - * @param string|number $sectionId Section identifier as a number or string + * @param string|int $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'). * @param string $defaultText Default to return if section is not found * @@ -5594,7 +5594,7 @@ class Parser { * section does not exist, $oldtext is returned unchanged. * * @param string $oldText Former text of the article - * @param string|number $sectionId Section identifier as a number or string + * @param string|int $sectionId Section identifier as a number or string * (e.g. 0, 1 or 'T-1'). * @param string $newText Replacing text * diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index 91e0b02087..ef2827c9b6 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -56,7 +56,7 @@ class ResourceLoaderClientHtml { /** * @param ResourceLoaderContext $context - * @param aray $target [optional] Custom 'target' parameter for the startup module + * @param string|null $target [optional] Custom 'target' parameter for the startup module */ public function __construct( ResourceLoaderContext $context, $target = null ) { $this->context = $context; diff --git a/includes/specials/SpecialMediaStatistics.php b/includes/specials/SpecialMediaStatistics.php index e11977fda3..dc88cbea2a 100644 --- a/includes/specials/SpecialMediaStatistics.php +++ b/includes/specials/SpecialMediaStatistics.php @@ -22,6 +22,8 @@ * @author Brian Wolff */ +use stdClass; + /** * @ingroup SpecialPage */ @@ -339,7 +341,7 @@ class MediaStatisticsPage extends QueryPage { * we need to implement since abstract in parent class. * * @param Skin $skin - * @param stdObject $result Result row + * @param stdClass $result Result row * @return bool|string|void * @throws MWException */ diff --git a/tests/phan/config.php b/tests/phan/config.php index dc6bb89693..20ba519b1f 100644 --- a/tests/phan/config.php +++ b/tests/phan/config.php @@ -351,8 +351,6 @@ return [ "PhanUndeclaredProperty", // approximate error count: 9 "PhanUndeclaredStaticMethod", - // approximate error count: 15 - "PhanUndeclaredTypeParameter", // approximate error count: 79 "PhanUndeclaredVariable", ],