Fix parameter type docs
authorLeszek Manicki <leszek.manicki@wikimedia.de>
Wed, 14 Dec 2016 16:01:47 +0000 (17:01 +0100)
committerLeszek Manicki <leszek.manicki@wikimedia.de>
Wed, 14 Dec 2016 16:01:47 +0000 (17:01 +0100)
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

includes/Message.php
includes/content/Content.php
includes/content/WikitextContent.php
includes/libs/xmp/XMP.php
includes/page/WikiPage.php
includes/parser/Parser.php
includes/resourceloader/ResourceLoaderClientHtml.php
includes/specials/SpecialMediaStatistics.php
tests/phan/config.php

index 9c0ab1c..2816aed 100644 (file)
@@ -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 ];
index 931128f..6a0a63b 100644 (file)
@@ -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
index 9296728..d649baf 100644 (file)
@@ -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
         *
index d12af7a..a657a33 100644 (file)
@@ -491,7 +491,7 @@ class XMPReader implements LoggerAwareInterface {
         * <exif:DigitalZoomRatio>0/10</exif:DigitalZoomRatio>
         * 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 "<space>" element
         * @param array $attribs Attribute name => value
         * @throws RuntimeException
index 0bb47ba..1c11b4f 100644 (file)
@@ -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.
index 8c93669..7418547 100644 (file)
@@ -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:
         *   "<flag1> - <flag2> - ... - <section number>"
         *
         * 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
         *
index 91e0b02..ef2827c 100644 (file)
@@ -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;
index e11977f..dc88cbe 100644 (file)
@@ -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
         */
index dc6bb89..20ba519 100644 (file)
@@ -351,8 +351,6 @@ return [
                "PhanUndeclaredProperty",
                // approximate error count: 9
                "PhanUndeclaredStaticMethod",
-               // approximate error count: 15
-               "PhanUndeclaredTypeParameter",
                // approximate error count: 79
                "PhanUndeclaredVariable",
        ],