phan: Fix type for IMaintainableDatabase::fieldExists on updater

Since core change dffca06 the fieldExists function is only for
maintenance database connections.
Phan reports the type error, the real object on runtime implements the
necessary method, so adjust the doc

Follow-Up: I282cd08d47be1e16cd05903d92561da04889768f
Change-Id: I6d78b3958dc68a61be7e6811b36cc772fa165ffd
This commit is contained in:
Umherirrender 2022-08-16 22:39:49 +02:00 committed by Reedy
parent 5ec4093b7f
commit 7b6d8ccdea

View file

@ -6,7 +6,7 @@ use ConfigException;
use DatabaseUpdater;
use FormatJson;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\IDatabase;
use Wikimedia\Rdbms\IMaintainableDatabase;
class UpdateTables {
/**
@ -94,7 +94,7 @@ class UpdateTables {
}
/**
* @return IDatabase
* @return IMaintainableDatabase
*/
private static function getDatabase() {
global $wgOATHAuthDatabase;
@ -137,11 +137,11 @@ class UpdateTables {
/**
* Converts old, TOTP specific, column values to new structure
* @param IDatabase $db
* @param IMaintainableDatabase $db
* @return bool
* @throws ConfigException
*/
public static function convertToGenericFields( IDatabase $db ) {
public static function convertToGenericFields( IMaintainableDatabase $db ) {
if ( !$db->fieldExists( 'oathauth_users', 'secret', __METHOD__ ) ) {
return true;
}
@ -190,11 +190,11 @@ class UpdateTables {
/**
* Switch from using single keys to multi-key support
*
* @param IDatabase $db
* @param IMaintainableDatabase $db
* @return bool
* @throws ConfigException
*/
public static function switchTOTPToMultipleKeys( IDatabase $db ) {
public static function switchTOTPToMultipleKeys( IMaintainableDatabase $db ) {
if ( !$db->fieldExists( 'oathauth_users', 'data', __METHOD__ ) ) {
return true;
}
@ -231,11 +231,11 @@ class UpdateTables {
/**
* Switch scratch tokens from string to an array
*
* @param IDatabase $db
* @param IMaintainableDatabase $db
* @return bool
* @throws ConfigException
*/
public static function switchTOTPScratchTokensToArray( IDatabase $db ) {
public static function switchTOTPScratchTokensToArray( IMaintainableDatabase $db ) {
if ( !$db->fieldExists( 'oathauth_users', 'data' ) ) {
return true;
}