Change doc type from DatabaseBase to IDatabase

Change-Id: I853b7cef85fdd77c28a947a8f3601f84ba17359a
This commit is contained in:
Umherirrender 2017-12-22 23:20:13 +01:00
parent 611fdde4d9
commit 08cb7a470a
7 changed files with 10 additions and 8 deletions

View file

@ -73,7 +73,7 @@ class MWEchoDbFactory {
* Get the database connection for Echo
* @param int $db Index of the connection to get
* @param mixed $groups Query groups.
* @return IDatabase
* @return \Wikimedia\Rdbms\IDatabase
*/
public function getEchoDb( $db, $groups = [] ) {
return $this->getLB()->getConnection( $db, $groups );
@ -82,7 +82,7 @@ class MWEchoDbFactory {
/**
* @param int $db Index of the connection to get
* @param array $groups Query groups
* @return bool|IDatabase false if no shared db is configured
* @return bool|\Wikimedia\Rdbms\IDatabase false if no shared db is configured
*/
public function getSharedDb( $db, $groups = [] ) {
if ( !$this->shared ) {
@ -102,7 +102,7 @@ class MWEchoDbFactory {
* @param int $db Index of the connection to get
* @param mixed $groups Query groups.
* @param string|bool $wiki The wiki ID, or false for the current wiki
* @return IDatabase
* @return \Wikimedia\Rdbms\IDatabase
*/
public static function getDB( $db, $groups = [], $wiki = false ) {
global $wgEchoCluster;

View file

@ -45,7 +45,7 @@ class EchoUnreadWikis {
/**
* @param int $index DB_* constant
* @return bool|DatabaseBase
* @return bool|\Wikimedia\Rdbms\IDatabase
*/
private function getDB( $index ) {
return $this->dbFactory->getSharedDb( $index );

View file

@ -1,5 +1,7 @@
<?php
use Wikimedia\Rdbms\IDatabase;
/**
* Database mapper for EchoNotification model
*/

View file

@ -93,7 +93,7 @@ class EchoUserNotificationGatewayTest extends MediaWikiTestCase {
}
/**
* Mock object of DatabaseMysql ( DatabaseBase )
* Mock object of DatabaseMysql ( \Wikimedia\Rdbms\IDatabase )
*/
protected function mockDb( array $dbResult = [] ) {
$dbResult += [

View file

@ -99,7 +99,7 @@ class EchoEventMapperTest extends MediaWikiTestCase {
}
/**
* Mock object of DatabaseMysql ( DatabaseBase )
* Mock object of DatabaseMysql ( \Wikimedia\Rdbms\IDatabase )
*/
protected function mockDb( array $dbResult ) {
$dbResult += [

View file

@ -216,7 +216,7 @@ class EchoNotificationMapperTest extends MediaWikiTestCase {
}
/**
* Mock object of DatabaseMysql ( DatabaseBase )
* Mock object of DatabaseMysql ( \Wikimedia\Rdbms\IDatabase )
*/
protected function mockDb( array $dbResult ) {
$dbResult += [

View file

@ -69,7 +69,7 @@ class EchoTargetPageMapperTest extends MediaWikiTestCase {
}
/**
* Mock object of DatabaseMysql ( DatabaseBase )
* Mock object of DatabaseMysql ( \Wikimedia\Rdbms\IDatabase )
*/
protected function mockDb( array $dbResult ) {
$dbResult += [