build: Bump mediawiki-phan-config to 0.8.0
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Tue, 23 Jun 2020 10:19:13 +0000 (12:19 +0200)
committerDaimona Eaytoy <daimona.wiki@gmail.com>
Tue, 23 Jun 2020 11:30:33 +0000 (11:30 +0000)
So that our CI docker image will work.

Disabling new issues (and removing now-unused suppressions) seems better
than attempting to fix all 300 of them.

Bug: T256088
Change-Id: Ide4a93043244fe254befe55e11a19dafd37a5fe8

16 files changed:
.phan/config.php
composer.json
includes/GlobalFunctions.php
includes/Setup.php
includes/api/ApiOpenSearch.php
includes/api/ApiQueryUsers.php
includes/filerepo/file/ForeignAPIFile.php
includes/libs/http/MultiHttpClient.php
includes/libs/objectcache/wancache/WANObjectCache.php
includes/libs/rdbms/database/Database.php
includes/libs/rdbms/loadmonitor/LoadMonitorMySQL.php
includes/media/FormatMetadata.php
includes/media/IPTC.php
includes/specials/SpecialLinkSearch.php
includes/widget/search/SearchFormWidget.php
maintenance/copyFileBackend.php

index 0fdefe0..62ceb27 100644 (file)
@@ -101,6 +101,9 @@ $cfg['suppress_issue_types'] = array_merge( $cfg['suppress_issue_types'], [
        //after dropping HHVM
        // approximate error count: 110
        "PhanParamTooMany", // False positives with variargs. Unsuppress after dropping HHVM
+       // New errors in phan 0.8.0, see T256088
+       'PhanTypeArraySuspiciousNullable',
+       'PhanEmptyForeach',
 ] );
 
 // This helps a lot in discovering bad code, but unfortunately it will always fail for
index 22a8277..0cc1dc9 100644 (file)
@@ -77,7 +77,7 @@
                "wikimedia/avro": "1.9.0",
                "wikimedia/testing-access-wrapper": "~1.0",
                "wmde/hamcrest-html-matchers": "^0.1.0",
-               "mediawiki/mediawiki-phan-config": "0.7.1",
+               "mediawiki/mediawiki-phan-config": "0.8.0",
                "symfony/yaml": "3.4.28",
                "johnkary/phpunit-speedtrap": "^1.0 | ^2.0"
        },
index 6396290..a6cfa0f 100644 (file)
@@ -1127,7 +1127,6 @@ function wfLogProfilingData() {
        if ( isset( $ctx['forwarded_for'] ) ||
                isset( $ctx['client_ip'] ) ||
                isset( $ctx['from'] ) ) {
-               // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                $ctx['proxy'] = $_SERVER['REMOTE_ADDR'];
        }
 
index 77d2a49..6670f45 100644 (file)
@@ -391,7 +391,6 @@ $wgSkipSkins[] = 'apioutput';
 if ( $wgLocalInterwiki ) {
        // Hard deprecated in 1.34.
        wfDeprecated( '$wgLocalInterwiki – use $wgLocalInterwikis instead', '1.23' );
-       // @phan-suppress-next-line PhanUndeclaredVariableDim
        array_unshift( $wgLocalInterwikis, $wgLocalInterwiki );
 }
 
index 7fcb818..6d66f5a 100644 (file)
@@ -251,7 +251,6 @@ class ApiOpenSearch extends ApiBase {
                                        if ( is_string( $r['extract'] ) && $r['extract'] !== '' ) {
                                                $item['Description'] = $r['extract'];
                                        }
-                                       // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                                        if ( is_array( $r['image'] ) && isset( $r['image']['source'] ) ) {
                                                $item['Image'] = array_intersect_key( $r['image'], $imageKeys );
                                        }
index 0171a37..6d4f463 100644 (file)
@@ -329,7 +329,6 @@ class ApiQueryUsers extends ApiQueryBase {
                                }
                        }
 
-                       // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                        $fit = $result->addValue( [ 'query', $this->getModuleName() ], null, $data[$u] );
                        if ( !$fit ) {
                                if ( $useNames ) {
index 99ead16..ab8ef2f 100644 (file)
@@ -75,7 +75,6 @@ class ForeignAPIFile extends File {
                                ? count( $data['query']['redirects'] ) - 1
                                : -1;
                        if ( $lastRedirect >= 0 ) {
-                               // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                                $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
                                $img = new self( $newtitle, $repo, $info, true );
                                $img->redirectedFrom( $title->getDBkey() );
index 85959d6..2a080aa 100644 (file)
@@ -414,7 +414,6 @@ class MultiHttpClient implements LoggerAwareInterface {
                                if ( $hasOutputStream ) {
                                        return fwrite( $req['stream'], $data );
                                } else {
-                                       // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                                        $req['response']['body'] .= $data;
 
                                        return strlen( $data );
index 2f44a55..dc8f5cd 100644 (file)
@@ -1311,7 +1311,6 @@ class WANObjectCache implements IExpiringStore, IStoreKeyEncoder, LoggerAwareInt
         *   - Cached or regenerated value version number or null if not versioned
         *   - Timestamp of the current cached value at the key or null if there is no value
         * @note Callable type hints are not used to avoid class-autoloading
-        * @suppress PhanTypeArraySuspicious
         */
        private function fetchOrRegenerate( $key, $ttl, $callback, array $opts ) {
                $checkKeys = $opts['checkKeys'] ?? [];
index d4fe59c..1e3326a 100644 (file)
@@ -2179,6 +2179,7 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
                $opts = $this->makeUpdateOptions( $options );
                $sql = "UPDATE $opts $table SET " . $this->makeList( $values, self::LIST_SET );
 
+               // @phan-suppress-next-line PhanTypeComparisonFromArray
                if ( $conds !== [] && $conds !== '*' ) {
                        $sql .= " WHERE " . $this->makeList( $conds, self::LIST_AND );
                }
index 5ae5bbd..7383472 100644 (file)
@@ -44,6 +44,7 @@ class LoadMonitorMySQL extends LoadMonitor {
 
        protected function getWeightScale( $index, IDatabase $conn = null ) {
                if ( !$conn ) {
+                       // @phan-suppress-next-line PhanTypeMismatchArgumentReal
                        return parent::getWeightScale( $index, $conn );
                }
 
index 6bce89a..21b3d48 100644 (file)
@@ -98,7 +98,6 @@ class FormatMetadata extends ContextSource {
         *   Exif::getFilteredData() or BitmapMetadataHandler )
         * @return array
         * @since 1.23
-        * @suppress PhanTypeArraySuspiciousNullable
         */
        public function makeFormattedData( $tags ) {
                $resolutionunit = !isset( $tags['ResolutionUnit'] ) || $tags['ResolutionUnit'] == 2 ? 2 : 3;
index c32db28..683ded1 100644 (file)
@@ -36,7 +36,6 @@ class IPTC {
         *
         * @param string $rawData The app13 block from jpeg containing iptc/iim data
         * @return array IPTC metadata array
-        * @suppress PhanTypeArraySuspicious
         */
        static function parse( $rawData ) {
                $parsed = iptcparse( $rawData );
index 60aedda..da4de21 100644 (file)
@@ -182,6 +182,7 @@ class SpecialLinkSearch extends QueryPage {
                }
 
                $orderBy = [];
+               // @phan-suppress-next-line PhanTypeMismatchDimFetch
                if ( !isset( $this->mungedQuery['el_index_60'] ) ) {
                        $orderBy[] = 'el_index_60';
                }
index fedac4b..62ee9cb 100644 (file)
@@ -148,7 +148,6 @@ class SearchFormWidget {
         * @param string $profile The currently selected profile
         * @param string $term The user provided search terms
         * @return string HTML
-        * @suppress PhanTypeArraySuspiciousNullable
         */
        protected function profileTabsHtml( $profile, $term ) {
                $bareterm = $this->startsWithImage( $term )
index 9e36742..a70e90c 100644 (file)
@@ -358,7 +358,6 @@ class CopyFileBackend extends Maintenance {
                        // backends in FileBackendMultiWrite (since they get writes second, they have
                        // higher timestamps). However, when copying the other way, this hits loads of
                        // false positives (possibly 100%) and wastes a bunch of time on GETs/PUTs.
-                       // @phan-suppress-next-line PhanTypeArraySuspiciousNullable
                        $same = ( $srcStat['mtime'] <= $dstStat['mtime'] );
                } else {
                        // This is the slowest method which does many per-file HEADs (unless an object