Merge "Upgrade phan to 0.10.2"

This commit is contained in:
jenkins-bot 2020-04-16 14:43:06 +00:00 committed by Gerrit Code Review
commit 048fb62c66
9 changed files with 10 additions and 5 deletions

View file

@ -18,6 +18,7 @@
* @file
*/
$disableTaintCheck = true;
$cfg = require __DIR__ . '/../vendor/mediawiki/mediawiki-phan-config/src/config.php';
$cfg['file_list'] = array_merge(

View file

@ -73,7 +73,7 @@
"johnkary/phpunit-speedtrap": "^3.1",
"justinrainbow/json-schema": "~5.2",
"mediawiki/mediawiki-codesniffer": "30.0.0",
"mediawiki/mediawiki-phan-config": "0.9.2",
"mediawiki/mediawiki-phan-config": "0.10.2",
"monolog/monolog": "~1.25.3",
"nikic/php-parser": "4.4.0",
"nmred/kafka-php": "0.1.5",

View file

@ -54,6 +54,7 @@ class HTMLFormFieldCloner extends HTMLFormField {
}
// Make sure the delete button, if explicitly specified, is sane
// @phan-suppress-next-line PhanTypeMismatchDimFetch Phan is very confused
if ( isset( $this->mParams['fields']['delete'] ) ) {
$class = 'mw-htmlform-cloner-delete-button';
$info = $this->mParams['fields']['delete'] + [

View file

@ -2341,7 +2341,6 @@ abstract class Database implements IDatabase, IMaintainableDatabase, LoggerAware
$opts = $this->makeUpdateOptions( $options );
$sql = "UPDATE $opts $table SET " . $this->makeList( $set, self::LIST_SET );
// @phan-suppress-next-line PhanTypeComparisonFromArray
if ( $conds !== [] && $conds !== '*' ) {
$sql .= " WHERE " . $this->makeList( $conds, self::LIST_AND );
}

View file

@ -81,7 +81,7 @@ abstract class Preprocessor {
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$key = $cache->makeKey(
// @phan-suppress-next-line PhanUndeclaredConstant
// @phan-suppress-next-line PhanUndeclaredConstantOfClass
defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class,
md5( $text ),
$flags
@ -114,7 +114,7 @@ abstract class Preprocessor {
$cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
$key = $cache->makeKey(
// @phan-suppress-next-line PhanUndeclaredConstant
// @phan-suppress-next-line PhanUndeclaredConstantOfClass
defined( 'static::CACHE_PREFIX' ) ? static::CACHE_PREFIX : static::class,
md5( $text ),
$flags

View file

@ -38,6 +38,7 @@ class ResourceLoaderOOUIIconPackModule extends ResourceLoaderOOUIImageModule {
}
private function getIcons() {
// @phan-suppress-next-line PhanTypeArraySuspiciousNullable Checked in the constructor
return $this->definition['icons'];
}

View file

@ -92,6 +92,7 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule {
* @param string $theme
* @param string $module
* @return array
* @suppress PhanTypeArraySuspiciousNullable
*/
protected function loadOOUIDefinition( $theme, $module ) {
// Find the path to the JSON file which contains the actual image definitions for this theme

View file

@ -566,6 +566,7 @@ abstract class BaseTemplate extends QuickTemplate {
unset( $buttonAttrs['width'] );
unset( $buttonAttrs['height'] );
$imgAttrs = [
// @phan-suppress-next-line PhanTypeInvalidDimOffset
'src' => $attrs['src'],
'alt' => $attrs['alt'] ?? wfMessage( 'searchbutton' )->text(),
'width' => $attrs['width'] ?? null,

View file

@ -977,7 +977,8 @@ abstract class LanguageConverter implements ILanguageConverter {
}
$this->mTablesLoaded = true;
$this->mTables = null;
// Do not use null as starting value, as that would confuse phan a lot.
$this->mTables = [];
$cache = ObjectCache::getInstance( $wgLanguageConverterCacheType );
$cacheKey = $cache->makeKey( 'conversiontables', $this->mMainLanguageCode );
if ( $fromCache ) {