Fix type annotations
authorMax Semenik <maxsem.wiki@gmail.com>
Thu, 15 Dec 2016 21:59:32 +0000 (13:59 -0800)
committerMax Semenik <maxsem.wiki@gmail.com>
Thu, 15 Dec 2016 22:11:12 +0000 (14:11 -0800)
Change-Id: Ib72c98358b2f0b3b73b6f105adea47346373d46d

includes/Title.php
includes/pager/TablePager.php
maintenance/orphans.php
tests/phan/config.php

index 3c51bae..f8bd8dc 100644 (file)
@@ -1627,7 +1627,7 @@ class Title implements LinkTarget {
         *
         * @since 1.19 (r105919)
         * @param array|string $query
-        * @param bool $query2
+        * @param string|string[]|bool $query2
         * @return string
         */
        private static function fixUrlQueryArgs( $query, $query2 = false ) {
@@ -1663,8 +1663,8 @@ class Title implements LinkTarget {
         *
         * @see self::getLocalURL for the arguments.
         * @see wfExpandUrl
-        * @param array|string $query
-        * @param bool $query2
+        * @param string|string[] $query
+        * @param string|string[]|bool $query2
         * @param string $proto Protocol type to use in URL
         * @return string The URL
         */
@@ -1696,11 +1696,11 @@ class Title implements LinkTarget {
         *  valid to link, locally, to the current Title.
         * @see self::newFromText to produce a Title object.
         *
-        * @param string|array $query An optional query string,
+        * @param string|string[] $query An optional query string,
         *   not used for interwiki links. Can be specified as an associative array as well,
         *   e.g., array( 'action' => 'edit' ) (keys and values will be URL-escaped).
         *   Some query patterns will trigger various shorturl path replacements.
-        * @param array $query2 An optional secondary query array. This one MUST
+        * @param string|string[]|bool $query2 An optional secondary query array. This one MUST
         *   be an array. If a string is passed it will be interpreted as a deprecated
         *   variant argument and urlencoded into a variant= argument.
         *   This second query argument will be added to the $query
@@ -1795,7 +1795,7 @@ class Title implements LinkTarget {
         * The result obviously should not be URL-escaped, but does need to be
         * HTML-escaped if it's being output in HTML.
         *
-        * @param array $query
+        * @param string|string[] $query
         * @param bool $query2
         * @param string|int|bool $proto A PROTO_* constant on how the URL should be expanded,
         *                               or false (default) for no expansion
index f2fca68..770c1c6 100644 (file)
@@ -336,7 +336,7 @@ abstract class TablePager extends IndexPager {
        /**
         * Get a "<select>" element which has options for each of the allowed limits
         *
-        * @param string $attribs Extra attributes to set
+        * @param string[] $attribs Extra attributes to set
         * @return string HTML fragment
         */
        public function getLimitSelect( $attribs = [] ) {
index e4f3e91..2da8830 100644 (file)
@@ -57,7 +57,7 @@ class Orphans extends Maintenance {
        /**
         * Lock the appropriate tables for the script
         * @param Database $db
-        * @param string $extraTable The name of any extra tables to lock (eg: text)
+        * @param string[] $extraTable The name of any extra tables to lock (eg: text)
         */
        private function lockTables( $db, $extraTable = [] ) {
                $tbls = [ 'page', 'revision', 'redirect' ];
index 5259ec9..afcd7f3 100644 (file)
@@ -325,8 +325,6 @@ return [
                "PhanTypeMismatchArgument",
                // approximate error count: 39
                "PhanTypeMismatchArgumentInternal",
-               // approximate error count: 4
-               "PhanTypeMismatchDefault",
                // approximate error count: 16
                "PhanTypeMismatchForeach",
                // approximate error count: 63