mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/OATHAuth
synced 2024-12-11 16:16:06 +00:00
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
(cherry picked from commit 7b6d8ccdea
)
This commit is contained in:
parent
36d7b9da36
commit
3171a37b49
|
@ -6,7 +6,7 @@ use ConfigException;
|
||||||
use DatabaseUpdater;
|
use DatabaseUpdater;
|
||||||
use FormatJson;
|
use FormatJson;
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
use Wikimedia\Rdbms\IDatabase;
|
use Wikimedia\Rdbms\IMaintainableDatabase;
|
||||||
|
|
||||||
class UpdateTables {
|
class UpdateTables {
|
||||||
/**
|
/**
|
||||||
|
@ -94,7 +94,7 @@ class UpdateTables {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return IDatabase
|
* @return IMaintainableDatabase
|
||||||
*/
|
*/
|
||||||
private static function getDatabase() {
|
private static function getDatabase() {
|
||||||
global $wgOATHAuthDatabase;
|
global $wgOATHAuthDatabase;
|
||||||
|
@ -137,11 +137,11 @@ class UpdateTables {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Converts old, TOTP specific, column values to new structure
|
* Converts old, TOTP specific, column values to new structure
|
||||||
* @param IDatabase $db
|
* @param IMaintainableDatabase $db
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
public static function convertToGenericFields( IDatabase $db ) {
|
public static function convertToGenericFields( IMaintainableDatabase $db ) {
|
||||||
if ( !$db->fieldExists( 'oathauth_users', 'secret', __METHOD__ ) ) {
|
if ( !$db->fieldExists( 'oathauth_users', 'secret', __METHOD__ ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -190,11 +190,11 @@ class UpdateTables {
|
||||||
/**
|
/**
|
||||||
* Switch from using single keys to multi-key support
|
* Switch from using single keys to multi-key support
|
||||||
*
|
*
|
||||||
* @param IDatabase $db
|
* @param IMaintainableDatabase $db
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
public static function switchTOTPToMultipleKeys( IDatabase $db ) {
|
public static function switchTOTPToMultipleKeys( IMaintainableDatabase $db ) {
|
||||||
if ( !$db->fieldExists( 'oathauth_users', 'data', __METHOD__ ) ) {
|
if ( !$db->fieldExists( 'oathauth_users', 'data', __METHOD__ ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -231,11 +231,11 @@ class UpdateTables {
|
||||||
/**
|
/**
|
||||||
* Switch scratch tokens from string to an array
|
* Switch scratch tokens from string to an array
|
||||||
*
|
*
|
||||||
* @param IDatabase $db
|
* @param IMaintainableDatabase $db
|
||||||
* @return bool
|
* @return bool
|
||||||
* @throws ConfigException
|
* @throws ConfigException
|
||||||
*/
|
*/
|
||||||
public static function switchTOTPScratchTokensToArray( IDatabase $db ) {
|
public static function switchTOTPScratchTokensToArray( IMaintainableDatabase $db ) {
|
||||||
if ( !$db->fieldExists( 'oathauth_users', 'data' ) ) {
|
if ( !$db->fieldExists( 'oathauth_users', 'data' ) ) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue