mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-27 17:20:40 +00:00
Change doc type from DatabaseBase to IDatabase
Change-Id: I853b7cef85fdd77c28a947a8f3601f84ba17359a
This commit is contained in:
parent
611fdde4d9
commit
08cb7a470a
|
@ -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;
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use Wikimedia\Rdbms\IDatabase;
|
||||
|
||||
/**
|
||||
* Database mapper for EchoNotification model
|
||||
*/
|
||||
|
|
|
@ -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 += [
|
||||
|
|
|
@ -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 += [
|
||||
|
|
|
@ -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 += [
|
||||
|
|
|
@ -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 += [
|
||||
|
|
Loading…
Reference in a new issue