Daniel Kinzler has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401524 )

Change subject: Hint against IDatabase instead of the Database base class.
......................................................................

Hint against IDatabase instead of the Database base class.

Change-Id: Ic05b606c3c9b855bd45a8203f510b9d5991a27d4
---
M client/includes/Specials/SpecialUnconnectedPages.php
M client/includes/UpdateRepo/UpdateRepo.php
M client/includes/UpdateRepo/UpdateRepoOnMove.php
M client/includes/Usage/Sql/EntityUsageTable.php
M client/includes/Usage/Sql/EntityUsageTableBuilder.php
M client/includes/Usage/Sql/SqlSubscriptionManager.php
M client/includes/Usage/Sql/SqlUsageTracker.php
M lib/includes/Store/Sql/SiteLinkTable.php
M lib/includes/Store/Sql/TermSqlIndex.php
M repo/includes/Store/SiteLinkConflictLookup.php
M repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php
M repo/includes/Store/Sql/DatabaseSchemaUpdater.php
M repo/includes/Store/Sql/LockManagerSqlChangeDispatchCoordinator.php
M repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
M repo/includes/Store/Sql/SqlIdGenerator.php
M repo/includes/Store/Sql/SqlSiteLinkConflictLookup.php
M repo/includes/Store/Sql/SqlSubscriptionLookup.php
M repo/includes/Store/Sql/TermSearchKeyBuilder.php
18 files changed, 80 insertions(+), 80 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase 
refs/changes/24/401524/1

diff --git a/client/includes/Specials/SpecialUnconnectedPages.php 
b/client/includes/Specials/SpecialUnconnectedPages.php
index d5766b6..7f8a0a1 100644
--- a/client/includes/Specials/SpecialUnconnectedPages.php
+++ b/client/includes/Specials/SpecialUnconnectedPages.php
@@ -9,7 +9,7 @@
 use Title;
 use Wikibase\Client\WikibaseClient;
 use Wikibase\Client\NamespaceChecker;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\FakeResultWrapper;
 use Wikimedia\Rdbms\ResultWrapper;
 
@@ -83,13 +83,13 @@
        /**
         * Build conditionals for namespace
         *
-        * @param Database $dbr
+        * @param IDatabase $dbr
         * @param Title|null $title
         * @param NamespaceChecker|null $checker
         *
         * @return string[]
         */
-       public function buildConditionals( Database $dbr, Title $title = null, 
NamespaceChecker $checker = null ) {
+       public function buildConditionals( IDatabase $dbr, Title $title = null, 
NamespaceChecker $checker = null ) {
                $conds = [];
 
                if ( $checker === null ) {
diff --git a/client/includes/UpdateRepo/UpdateRepo.php 
b/client/includes/UpdateRepo/UpdateRepo.php
index edb3968..978259d 100644
--- a/client/includes/UpdateRepo/UpdateRepo.php
+++ b/client/includes/UpdateRepo/UpdateRepo.php
@@ -51,7 +51,7 @@
        private $entityId = false;
 
        /**
-        * @param string $repoDB Database name of the repo
+        * @param string $repoDB IDatabase name of the repo
         * @param SiteLinkLookup $siteLinkLookup
         * @param User $user
         * @param string $siteId Global id of the client wiki
diff --git a/client/includes/UpdateRepo/UpdateRepoOnMove.php 
b/client/includes/UpdateRepo/UpdateRepoOnMove.php
index 992a298..5798e88 100644
--- a/client/includes/UpdateRepo/UpdateRepoOnMove.php
+++ b/client/includes/UpdateRepo/UpdateRepoOnMove.php
@@ -20,7 +20,7 @@
        private $newTitle;
 
        /**
-        * @param string $repoDB Database name of the repo
+        * @param string $repoDB IDatabase name of the repo
         * @param SiteLinkLookup $siteLinkLookup
         * @param User $user
         * @param string $siteId Global id of the client wiki
diff --git a/client/includes/Usage/Sql/EntityUsageTable.php 
b/client/includes/Usage/Sql/EntityUsageTable.php
index 59a80df..769af95 100644
--- a/client/includes/Usage/Sql/EntityUsageTable.php
+++ b/client/includes/Usage/Sql/EntityUsageTable.php
@@ -11,7 +11,7 @@
 use Wikibase\Client\Usage\PageEntityUsages;
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\DataModel\Entity\EntityIdParser;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\DBUnexpectedError;
 use Wikimedia\Rdbms\LBFactory;
 
@@ -41,12 +41,12 @@
        private $idParser;
 
        /**
-        * @var Database
+        * @var IDatabase
         */
        private $writeConnection;
 
        /**
-        * @var Database
+        * @var IDatabase
         */
        private $readConnection;
 
@@ -67,7 +67,7 @@
 
        /**
         * @param EntityIdParser $idParser
-        * @param Database $writeConnection
+        * @param IDatabase $writeConnection
         * @param int $batchSize Batch size for database queries on the entity 
usage table, including
         *  INSERTs, SELECTs, and DELETEs. Defaults to 100.
         * @param string|null $tableName defaults to wbc_entity_usage
@@ -76,7 +76,7 @@
         */
        public function __construct(
                EntityIdParser $idParser,
-               Database $writeConnection,
+               IDatabase $writeConnection,
                $batchSize = 100,
                $tableName = null
        ) {
diff --git a/client/includes/Usage/Sql/EntityUsageTableBuilder.php 
b/client/includes/Usage/Sql/EntityUsageTableBuilder.php
index 4634b81..ffe2b4d 100644
--- a/client/includes/Usage/Sql/EntityUsageTableBuilder.php
+++ b/client/includes/Usage/Sql/EntityUsageTableBuilder.php
@@ -11,7 +11,7 @@
 use Wikibase\Lib\Reporting\LogWarningExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Lib\Reporting\NullMessageReporter;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 use Wikimedia\Rdbms\ResultWrapper;
 
@@ -140,12 +140,12 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param EntityId[] $entityPerPage
         *
         * @return int The number of rows inserted.
         */
-       private function insertUsageBatch( Database $db, array $entityPerPage ) 
{
+       private function insertUsageBatch( IDatabase $db, array $entityPerPage 
) {
                $db->startAtomic( __METHOD__ );
 
                $c = 0;
@@ -171,12 +171,12 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param int $fromPageId
         *
         * @return EntityId[] An associative array mapping page IDs to Entity 
IDs.
         */
-       private function getUsageBatch( Database $db, $fromPageId = 0 ) {
+       private function getUsageBatch( IDatabase $db, $fromPageId = 0 ) {
                $res = $db->select(
                        'page_props',
                        [ 'pp_page', 'pp_value' ],
diff --git a/client/includes/Usage/Sql/SqlSubscriptionManager.php 
b/client/includes/Usage/Sql/SqlSubscriptionManager.php
index d6d1a9a..bf1fa28 100644
--- a/client/includes/Usage/Sql/SqlSubscriptionManager.php
+++ b/client/includes/Usage/Sql/SqlSubscriptionManager.php
@@ -177,7 +177,7 @@
        }
 
        /**
-        * Returns a list of rows for insertion, using Database's multi-row 
insert mechanism.
+        * Returns a list of rows for insertion, using IDatabase's multi-row 
insert mechanism.
         * Each row is represented as array( $subscriber, $entityId ).
         *
         * @param string $subscriber
diff --git a/client/includes/Usage/Sql/SqlUsageTracker.php 
b/client/includes/Usage/Sql/SqlUsageTracker.php
index 02ec945..ffd1525 100644
--- a/client/includes/Usage/Sql/SqlUsageTracker.php
+++ b/client/includes/Usage/Sql/SqlUsageTracker.php
@@ -5,7 +5,7 @@
 use ArrayIterator;
 use InvalidArgumentException;
 use Traversable;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\DBError;
 use Wikimedia\Rdbms\SessionConsistentConnectionManager;
 use Wikibase\Client\Usage\EntityUsage;
@@ -57,11 +57,11 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         *
         * @return EntityUsageTable
         */
-       private function newUsageTable( Database $db ) {
+       private function newUsageTable( IDatabase $db ) {
                return new EntityUsageTable( $this->idParser, $db );
        }
 
diff --git a/lib/includes/Store/Sql/SiteLinkTable.php 
b/lib/includes/Store/Sql/SiteLinkTable.php
index 7e6fb89..f9b3c01 100644
--- a/lib/includes/Store/Sql/SiteLinkTable.php
+++ b/lib/includes/Store/Sql/SiteLinkTable.php
@@ -9,7 +9,7 @@
 use Wikibase\DataModel\Entity\ItemId;
 use Wikibase\DataModel\SiteLink;
 use Wikibase\Lib\Store\SiteLinkStore;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Represents a lookup database table for sitelinks.
@@ -119,11 +119,11 @@
        /**
         * @param Item $item
         * @param SiteLink[] $links
-        * @param Database $dbw
+        * @param IDatabase $dbw
         *
         * @return bool Success indicator
         */
-       private function insertLinks( Item $item, array $links, Database $dbw ) 
{
+       private function insertLinks( Item $item, array $links, IDatabase $dbw 
) {
                wfDebugLog( __CLASS__, __FUNCTION__ . ': inserting links for ' 
. $item->getId()->getSerialization() );
 
                $insert = [];
@@ -148,11 +148,11 @@
        /**
         * @param Item $item
         * @param SiteLink[] $links
-        * @param Database $dbw
+        * @param IDatabase $dbw
         *
         * @return bool Success indicator
         */
-       private function deleteLinks( Item $item, array $links, Database $dbw ) 
{
+       private function deleteLinks( Item $item, array $links, IDatabase $dbw 
) {
                wfDebugLog( __CLASS__, __FUNCTION__ . ': deleting links for ' . 
$item->getId()->getSerialization() );
 
                $siteIds = [];
diff --git a/lib/includes/Store/Sql/TermSqlIndex.php 
b/lib/includes/Store/Sql/TermSqlIndex.php
index c089162..d5c8a58 100644
--- a/lib/includes/Store/Sql/TermSqlIndex.php
+++ b/lib/includes/Store/Sql/TermSqlIndex.php
@@ -24,7 +24,7 @@
 use Wikibase\TermIndex;
 use Wikibase\TermIndexEntry;
 use Wikimedia\Assert\Assert;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Term lookup cache.
@@ -104,7 +104,7 @@
 
        /**
         * Returns the name of the database table used to store the terms.
-        * This is the logical table name, subject to prefixing by the Database 
object.
+        * This is the logical table name, subject to prefixing by the 
IDatabase object.
         *
         * @return string
         */
@@ -188,11 +188,11 @@
        /**
         * @param EntityDocument $entity
         * @param TermIndexEntry[] $terms
-        * @param Database $dbw
+        * @param IDatabase $dbw
         *
         * @return bool Success indicator
         */
-       private function insertTerms( EntityDocument $entity, array $terms, 
Database $dbw ) {
+       private function insertTerms( EntityDocument $entity, array $terms, 
IDatabase $dbw ) {
                $entityId = $entity->getId();
                $this->assertIsNumericEntityId( $entityId );
                /** @var EntityId|Int32EntityId $entityId */
@@ -223,11 +223,11 @@
        /**
         * @param array $entityIdentifiers Term table fields identifying an 
entity
         * @param TermIndexEntry $term
-        * @param Database $dbw
+        * @param IDatabase $dbw
         *
         * @return bool Success indicator
         */
-       private function insertTerm( array $entityIdentifiers, TermIndexEntry 
$term, Database $dbw ) {
+       private function insertTerm( array $entityIdentifiers, TermIndexEntry 
$term, IDatabase $dbw ) {
                $fields = array_merge(
                        $this->getTermFields( $term ),
                        $entityIdentifiers
@@ -345,11 +345,11 @@
        /**
         * @param EntityId $entityId
         * @param TermIndexEntry[] $terms
-        * @param Database $dbw
+        * @param IDatabase $dbw
         *
         * @return bool Success indicator
         */
-       private function deleteTerms( EntityId $entityId, array $terms, 
Database $dbw ) {
+       private function deleteTerms( EntityId $entityId, array $terms, 
IDatabase $dbw ) {
                //TODO: Make getTermsOfEntity() collect term_row_id values, so 
we can use them here.
                //      That would allow us to do the deletion in a single 
query, based on a set of ids.
 
@@ -608,18 +608,18 @@
        }
 
        /**
-        * Returns the Database connection from which to read.
+        * Returns the IDatabase connection from which to read.
         *
-        * @return Database
+        * @return IDatabase
         */
        public function getReadDb() {
                return $this->getConnection( DB_REPLICA );
        }
 
        /**
-        * Returns the Database connection to which to write.
+        * Returns the IDatabase connection to which to write.
         *
-        * @return Database
+        * @return IDatabase
         */
        public function getWriteDb() {
                return $this->getConnection( DB_MASTER );
@@ -778,7 +778,7 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param TermIndexSearchCriteria[] $criteria
         * @param string|string[]|null $termType
         * @param string|string[]|null $entityType
@@ -787,7 +787,7 @@
         * @return string[]
         */
        private function criteriaToConditions(
-               Database $db,
+               IDatabase $db,
                array $criteria,
                $termType = null,
                $entityType = null,
@@ -804,7 +804,7 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param TermIndexSearchCriteria $mask
         * @param string|string[]|null $termType
         * @param string|string[]|null $entityType
@@ -813,7 +813,7 @@
         * @return array
         */
        private function getTermMatchConditions(
-               Database $db,
+               IDatabase $db,
                TermIndexSearchCriteria $mask,
                $termType = null,
                $entityType = null,
diff --git a/repo/includes/Store/SiteLinkConflictLookup.php 
b/repo/includes/Store/SiteLinkConflictLookup.php
index a45e3c4..9c68f5f 100644
--- a/repo/includes/Store/SiteLinkConflictLookup.php
+++ b/repo/includes/Store/SiteLinkConflictLookup.php
@@ -3,7 +3,7 @@
 namespace Wikibase\Repo\Store;
 
 use Wikibase\DataModel\Entity\Item;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Contains methods for looking up SiteLink conflicts
@@ -23,7 +23,7 @@
         * - string sitePage
         *
         * @param Item          $item
-        * @param Database|null $db The database object to use (optional).
+        * @param IDatabase|null $db The database object to use (optional).
         *        If conflict checking is performed as part of a save operation,
         *        this should be used to provide the master DB connection that 
will
         *        also be used for saving. This will preserve transactional 
integrity
@@ -31,6 +31,6 @@
         *
         * @return array[] An array of arrays, each with the keys "siteId", 
"itemId" and "sitePage".
         */
-       public function getConflictsForItem( Item $item, Database $db = null );
+       public function getConflictsForItem( Item $item, IDatabase $db = null );
 
 }
diff --git a/repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php 
b/repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php
index fb98be0..c0bbce1 100644
--- a/repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php
+++ b/repo/includes/Store/Sql/ChangesSubscriptionTableBuilder.php
@@ -10,7 +10,7 @@
 use Wikibase\Lib\Reporting\LogWarningExceptionHandler;
 use Wikibase\Lib\Reporting\MessageReporter;
 use Wikibase\Lib\Reporting\NullMessageReporter;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 use Wikimedia\Rdbms\ResultWrapper;
 
@@ -148,12 +148,12 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param array[] $subscriptionsPerItem
         *
         * @return int The number of rows inserted.
         */
-       private function insertSubscriptionBatch( Database $db, array 
$subscriptionsPerItem ) {
+       private function insertSubscriptionBatch( IDatabase $db, array 
$subscriptionsPerItem ) {
                $db->startAtomic( __METHOD__ );
 
                $c = 0;
@@ -182,12 +182,12 @@
        }
 
        /**
-        * @param Database $db
+        * @param IDatabase $db
         * @param array &$continuation
         *
         * @return array[] An associative array mapping item IDs to lists of 
site IDs.
         */
-       private function getSubscriptionsPerItemBatch( Database $db, 
&$continuation = [] ) {
+       private function getSubscriptionsPerItemBatch( IDatabase $db, 
&$continuation = [] ) {
                if ( empty( $continuation ) ) {
                        $continuationCondition = '1';
                } else {
diff --git a/repo/includes/Store/Sql/DatabaseSchemaUpdater.php 
b/repo/includes/Store/Sql/DatabaseSchemaUpdater.php
index 7bacb4f..7dcddb1 100644
--- a/repo/includes/Store/Sql/DatabaseSchemaUpdater.php
+++ b/repo/includes/Store/Sql/DatabaseSchemaUpdater.php
@@ -17,7 +17,7 @@
 use Wikibase\Repo\Maintenance\PopulateTermFullEntityId;
 use Wikibase\Repo\WikibaseRepo;
 use Wikibase\Store;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * @license GPL-2.0+
@@ -119,7 +119,7 @@
                );
        }
 
-       private function updateItemsPerSiteTable( DatabaseUpdater $updater, 
Database $db ) {
+       private function updateItemsPerSiteTable( DatabaseUpdater $updater, 
IDatabase $db ) {
                // Make wb_items_per_site.ips_site_page VARCHAR(310) - T99459
                // NOTE: this update doesn't work on SQLite, but it's not 
needed there anyway.
                if ( $db->getType() !== 'sqlite' ) {
@@ -131,7 +131,7 @@
                }
        }
 
-       private function updateChangesTable( DatabaseUpdater $updater, Database 
$db ) {
+       private function updateChangesTable( DatabaseUpdater $updater, 
IDatabase $db ) {
                // Make wb_changes.change_info MEDIUMBLOB - T108246
                // NOTE: this update doesn't work on SQLite, but it's not 
needed there anyway.
                if ( $db->getType() !== 'sqlite' ) {
@@ -239,7 +239,7 @@
         * falling back to the plain ".sql" extension if no specific script is 
found.
         *
         * @param string $name the script's name, without file extension
-        * @param string $type the database type, as returned by 
Database::getType()
+        * @param string $type the database type, as returned by 
IDatabase::getType()
         *
         * @return string The path to the script file
         * @throws MWException If the script was not found in any script 
directory
@@ -275,9 +275,9 @@
         * Applies updates to the wb_terms table.
         *
         * @param DatabaseUpdater $updater
-        * @param Database $db
+        * @param IDatabase $db
         */
-       private function updateTermsTable( DatabaseUpdater $updater, Database 
$db ) {
+       private function updateTermsTable( DatabaseUpdater $updater, IDatabase 
$db ) {
                // ---- Update from 0.1 or 0.2. ----
                if ( !$db->fieldExists( 'wb_terms', 'term_search_key' ) ) {
                        $updater->addExtensionField(
diff --git 
a/repo/includes/Store/Sql/LockManagerSqlChangeDispatchCoordinator.php 
b/repo/includes/Store/Sql/LockManagerSqlChangeDispatchCoordinator.php
index eb8eafa..ed62bf1 100644
--- a/repo/includes/Store/Sql/LockManagerSqlChangeDispatchCoordinator.php
+++ b/repo/includes/Store/Sql/LockManagerSqlChangeDispatchCoordinator.php
@@ -4,7 +4,7 @@
 
 use LockManager;
 use Wikibase\Store\Sql\SqlChangeDispatchCoordinator;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LBFactory;
 
 /**
@@ -52,24 +52,24 @@
        /**
         * @see SqlChangeDispatchCoordinator::releaseClient()
         *
-        * @param Database $db The database connection to work on.
+        * @param IDatabase $db The database connection to work on.
         * @param string $lock The name of the lock to release.
         *
         * @return bool whether the lock was released successfully.
         */
-       protected function releaseClientLock( Database $db, $lock ) {
+       protected function releaseClientLock( IDatabase $db, $lock ) {
                return $this->lockManager->unlock( [ $lock ] )->isOK();
        }
 
        /**
         * @see SqlChangeDispatchCoordinator::isClientLockUsed()
         *
-        * @param Database $db The database connection to work on.
+        * @param IDatabase $db The database connection to work on.
         * @param string $lock The name of the lock to check.
         *
         * @return bool false since it's not needed in LockManager-based 
coordinators
         */
-       protected function isClientLockUsed( Database $db, $lock ) {
+       protected function isClientLockUsed( IDatabase $db, $lock ) {
                // Not needed
                return false;
        }
diff --git a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php 
b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
index 705adc6..0bb5185 100644
--- a/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
+++ b/repo/includes/Store/Sql/SqlChangeDispatchCoordinator.php
@@ -8,7 +8,7 @@
 use Wikibase\Lib\Reporting\NullMessageReporter;
 use Wikibase\Store\ChangeDispatchCoordinator;
 use Wikimedia\Assert\Assert;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\DBUnexpectedError;
 use Wikimedia\Rdbms\LBFactory;
 use Wikimedia\Rdbms\LoadBalancer;
@@ -220,23 +220,23 @@
        }
 
        /**
-        * @return Database A connection to the repo's master database
+        * @return IDatabase A connection to the repo's master database
         */
        private function getRepoMaster() {
                return $this->getRepoLB()->getConnection( DB_MASTER, [], 
$this->repoDB );
        }
 
        /**
-        * @return Database A connection to the repo's replica database
+        * @return IDatabase A connection to the repo's replica database
         */
        private function getRepoReplica() {
                return $this->getRepoLB()->getConnection( DB_REPLICA, [], 
$this->repoDB );
        }
 
        /**
-        * @param Database $db The repo database connection to release for 
re-use.
+        * @param IDatabase $db The repo database connection to release for 
re-use.
         */
-       private function releaseRepoDb( Database $db ) {
+       private function releaseRepoDb( IDatabase $db ) {
                $this->getRepoLB()->reuseConnection( $db );
        }
 
@@ -553,12 +553,12 @@
        /**
         * Releases the given global lock on the given client wiki.
         *
-        * @param Database $db The database connection to work on.
+        * @param IDatabase $db The database connection to work on.
         * @param string  $lock  The name of the lock to release.
         *
         * @return bool whether the lock was released successfully.
         */
-       protected function releaseClientLock( Database $db, $lock ) {
+       protected function releaseClientLock( IDatabase $db, $lock ) {
                if ( isset( $this->releaseClientLockOverride ) ) {
                        return call_user_func( 
$this->releaseClientLockOverride, $db, $lock );
                }
@@ -569,12 +569,12 @@
        /**
         * Checks the given global lock on the given client wiki.
         *
-        * @param Database $db The database connection to work on.
+        * @param IDatabase $db The database connection to work on.
         * @param string  $lock  The name of the lock to check.
         *
         * @return bool true if the given lock is currently held by another 
process, false otherwise.
         */
-       protected function isClientLockUsed( Database $db, $lock ) {
+       protected function isClientLockUsed( IDatabase $db, $lock ) {
                if ( isset( $this->isClientLockUsedOverride ) ) {
                        return call_user_func( $this->isClientLockUsedOverride, 
$db, $lock );
                }
diff --git a/repo/includes/Store/Sql/SqlIdGenerator.php 
b/repo/includes/Store/Sql/SqlIdGenerator.php
index 593819f..8a89cfa 100644
--- a/repo/includes/Store/Sql/SqlIdGenerator.php
+++ b/repo/includes/Store/Sql/SqlIdGenerator.php
@@ -3,7 +3,7 @@
 namespace Wikibase;
 
 use MWException;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 
 /**
@@ -52,14 +52,14 @@
        /**
         * Generates and returns a new ID.
         *
-        * @param Database $database
+        * @param IDatabase $database
         * @param string $type
         * @param bool $retry Retry once in case of e.g. race conditions. 
Defaults to true.
         *
         * @throws MWException
         * @return int
         */
-       private function generateNewId( Database $database, $type, $retry = 
true ) {
+       private function generateNewId( IDatabase $database, $type, $retry = 
true ) {
                $database->startAtomic( __METHOD__ );
 
                $currentId = $database->selectRow(
diff --git a/repo/includes/Store/Sql/SqlSiteLinkConflictLookup.php 
b/repo/includes/Store/Sql/SqlSiteLinkConflictLookup.php
index c929ff1..4ab3edd 100644
--- a/repo/includes/Store/Sql/SqlSiteLinkConflictLookup.php
+++ b/repo/includes/Store/Sql/SqlSiteLinkConflictLookup.php
@@ -7,7 +7,7 @@
 use Wikibase\DataModel\SiteLink;
 use Wikibase\Lib\EntityIdComposer;
 use Wikibase\Repo\Store\SiteLinkConflictLookup;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * @license GPL-2.0+
@@ -32,11 +32,11 @@
         * @see SiteLinkConflictLookup::getConflictsForItem
         *
         * @param Item $item
-        * @param Database|null $db
+        * @param IDatabase|null $db
         *
         * @return array[] An array of arrays, each with the keys "siteId", 
"itemId" and "sitePage".
         */
-       public function getConflictsForItem( Item $item, Database $db = null ) {
+       public function getConflictsForItem( Item $item, IDatabase $db = null ) 
{
                $siteLinks = $item->getSiteLinkList();
 
                if ( $siteLinks->isEmpty() ) {
diff --git a/repo/includes/Store/Sql/SqlSubscriptionLookup.php 
b/repo/includes/Store/Sql/SqlSubscriptionLookup.php
index f4e321b..69abe05 100644
--- a/repo/includes/Store/Sql/SqlSubscriptionLookup.php
+++ b/repo/includes/Store/Sql/SqlSubscriptionLookup.php
@@ -4,7 +4,7 @@
 
 use Wikibase\DataModel\Entity\EntityId;
 use Wikibase\Store\SubscriptionLookup;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 use Wikimedia\Rdbms\LoadBalancer;
 
 /**
@@ -82,13 +82,13 @@
        /**
         * For a set of potential subscriptions, returns the existing 
subscriptions.
         *
-        * @param Database $db
+        * @param IDatabase $db
         * @param string $subscriber
         * @param string[]|null $idsToCheck Id strings to check
         *
         * @return string[] Entity ID strings from $subscriptions which 
$subscriber is subscribed to.
         */
-       private function querySubscriptions( Database $db, $subscriber, array 
$idsToCheck = null ) {
+       private function querySubscriptions( IDatabase $db, $subscriber, array 
$idsToCheck = null ) {
                $where = [
                        'cs_subscriber_id' => $subscriber,
                ];
diff --git a/repo/includes/Store/Sql/TermSearchKeyBuilder.php 
b/repo/includes/Store/Sql/TermSearchKeyBuilder.php
index 5a3cd98..0f52790 100644
--- a/repo/includes/Store/Sql/TermSearchKeyBuilder.php
+++ b/repo/includes/Store/Sql/TermSearchKeyBuilder.php
@@ -5,7 +5,7 @@
 use Wikibase\Lib\Reporting\MessageReporter;
 use MediaWiki\MediaWikiServices;
 use Wikibase\Lib\Store\Sql\TermSqlIndex;
-use Wikimedia\Rdbms\Database;
+use Wikimedia\Rdbms\IDatabase;
 
 /**
  * Utility class for rebuilding the term_search_key field.
@@ -159,13 +159,13 @@
         *
         * @see TermSqlIndex::getSearchKey
         *
-        * @param Database $dbw the database connection to use
+        * @param IDatabase $dbw the database connection to use
         * @param int $rowId the row to update
         * @param string $text the term's text
         *
         * @return string|bool the search key, or false if no search key could 
be calculated.
         */
-       private function updateSearchKey( Database $dbw, $rowId, $text ) {
+       private function updateSearchKey( IDatabase $dbw, $rowId, $text ) {
                $key = $this->table->getSearchKey( $text );
 
                if ( $key === '' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/401524
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic05b606c3c9b855bd45a8203f510b9d5991a27d4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Daniel Kinzler <daniel.kinz...@wikimedia.de>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to