Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/243878

Change subject: Update more docs and type hints to use IDatabase
......................................................................

Update more docs and type hints to use IDatabase

Change-Id: I8c8d85b32a8aba21e14d2a2dde4c25eb509186c1
---
M includes/CategoryFinder.php
M includes/LinkFilter.php
M includes/RevisionList.php
M includes/SiteStats.php
M includes/UserRightsProxy.php
M includes/externalstore/ExternalStoreDB.php
M includes/filebackend/filejournal/DBFileJournal.php
M includes/filebackend/lockmanager/DBLockManager.php
M includes/filerepo/ForeignDBRepo.php
M includes/filerepo/ForeignDBViaLBRepo.php
M includes/jobqueue/JobRunner.php
M includes/libs/ObjectFactory.php
M includes/objectcache/SqlBagOStuff.php
M includes/pager/IndexPager.php
M includes/utils/BatchRowIterator.php
M includes/utils/BatchRowWriter.php
16 files changed, 35 insertions(+), 35 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/78/243878/1

diff --git a/includes/CategoryFinder.php b/includes/CategoryFinder.php
index 77c43bf..d779141 100644
--- a/includes/CategoryFinder.php
+++ b/includes/CategoryFinder.php
@@ -64,7 +64,7 @@
        /** @var string "AND" or "OR" */
        protected $mode;
 
-       /** @var DatabaseBase Read-DB slave */
+       /** @var IDatabase Read-DB slave */
        protected $dbr;
 
        /**
diff --git a/includes/LinkFilter.php b/includes/LinkFilter.php
index 7215cec..d15232a 100644
--- a/includes/LinkFilter.php
+++ b/includes/LinkFilter.php
@@ -71,7 +71,7 @@
        }
 
        /**
-        * Make an array to be used for calls to DatabaseBase::buildLike(), 
which
+        * Make an array to be used for calls to IDatabase::buildLike(), which
         * will match the specified string. There are several kinds of filter 
entry:
         *     *.domain.com    -  Produces http://com.domain.%, matches 
domain.com
         *                        and www.domain.com
@@ -89,7 +89,7 @@
         *
         * @param string $filterEntry Domainparts
         * @param string $protocol Protocol (default http://)
-        * @return array Array to be passed to DatabaseBase::buildLike() or 
false on error
+        * @return array Array to be passed to IDatabase::buildLike() or false 
on error
         */
        public static function makeLikeArray( $filterEntry, $protocol = 
'http://' ) {
                $db = wfGetDB( DB_SLAVE );
diff --git a/includes/RevisionList.php b/includes/RevisionList.php
index 1df0ca0..4d72c24 100644
--- a/includes/RevisionList.php
+++ b/includes/RevisionList.php
@@ -121,7 +121,7 @@
 
        /**
         * Do the DB query to iterate through the objects.
-        * @param IDatabase $db DatabaseBase object to use for the query
+        * @param IDatabase $db DB object to use for the query
         */
        abstract public function doQuery( $db );
 
diff --git a/includes/SiteStats.php b/includes/SiteStats.php
index 64e5ea0..4c76b87 100644
--- a/includes/SiteStats.php
+++ b/includes/SiteStats.php
@@ -281,12 +281,12 @@
 
        /**
         * Constructor
-        * @param bool|DatabaseBase $database
+        * @param bool|IDatabase $database
         * - Boolean: whether to use the master DB
-        * - DatabaseBase: database connection to use
+        * - IDatabase: database connection to use
         */
        public function __construct( $database = false ) {
-               if ( $database instanceof DatabaseBase ) {
+               if ( $database instanceof IDatabase ) {
                        $this->db = $database;
                } else {
                        $this->db = wfGetDB( $database ? DB_MASTER : DB_SLAVE );
@@ -366,7 +366,7 @@
         *
         * @param IDatabase|bool $database
         * - Boolean: whether to use the master DB
-        * - DatabaseBase: database connection to use
+        * - IDatabase: database connection to use
         * @param array $options Array of options, may contain the following 
values
         * - activeUsers Boolean: whether to update the number of active users 
(default: false)
         */
diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php
index 0d1708f..3a3eb53 100644
--- a/includes/UserRightsProxy.php
+++ b/includes/UserRightsProxy.php
@@ -146,7 +146,7 @@
         *
         * @param string $database
         * @param bool $ignoreInvalidDB If true, don't check if $database is in 
$wgLocalDatabases
-        * @return DatabaseBase|null If invalid selection
+        * @return IDatabase|null If invalid selection
         */
        public static function getDB( $database, $ignoreInvalidDB = false ) {
                global $wgDBname;
diff --git a/includes/externalstore/ExternalStoreDB.php 
b/includes/externalstore/ExternalStoreDB.php
index cc70960..57d9d71 100644
--- a/includes/externalstore/ExternalStoreDB.php
+++ b/includes/externalstore/ExternalStoreDB.php
@@ -116,7 +116,7 @@
         * Get a slave database connection for the specified cluster
         *
         * @param string $cluster Cluster name
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getSlave( $cluster ) {
                global $wgDefaultExternalStore;
@@ -141,7 +141,7 @@
         * Get a master database connection for the specified cluster
         *
         * @param string $cluster Cluster name
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getMaster( $cluster ) {
                $wiki = isset( $this->params['wiki'] ) ? $this->params['wiki'] 
: false;
@@ -268,7 +268,7 @@
         * Helper function for self::batchFetchBlobs for merging master/slave 
results
         * @param array &$ret Current self::batchFetchBlobs return value
         * @param array &$ids Map from blob_id to requested itemIDs
-        * @param mixed $res DB result from DatabaseBase::select
+        * @param mixed $res DB result from IDatabase::select
         */
        private function mergeBatchResult( array &$ret, array &$ids, $res ) {
                foreach ( $res as $row ) {
diff --git a/includes/filebackend/filejournal/DBFileJournal.php 
b/includes/filebackend/filejournal/DBFileJournal.php
index 4f64f02..0ade616 100644
--- a/includes/filebackend/filejournal/DBFileJournal.php
+++ b/includes/filebackend/filejournal/DBFileJournal.php
@@ -27,7 +27,7 @@
  * @since 1.20
  */
 class DBFileJournal extends FileJournal {
-       /** @var DatabaseBase */
+       /** @var IDatabase */
        protected $dbw;
 
        protected $wiki = false; // string; wiki DB name
@@ -174,7 +174,7 @@
        /**
         * Get a master connection to the logging DB
         *
-        * @return DatabaseBase
+        * @return IDatabase
         * @throws DBError
         */
        protected function getMasterDB() {
diff --git a/includes/filebackend/lockmanager/DBLockManager.php 
b/includes/filebackend/lockmanager/DBLockManager.php
index b81cf3e..9d4f009 100644
--- a/includes/filebackend/lockmanager/DBLockManager.php
+++ b/includes/filebackend/lockmanager/DBLockManager.php
@@ -146,7 +146,7 @@
         * Get (or reuse) a connection to a lock DB
         *
         * @param string $lockDb
-        * @return DatabaseBase
+        * @return IDatabase
         * @throws DBError
         */
        protected function getConnection( $lockDb ) {
@@ -185,10 +185,10 @@
         * Do additional initialization for new lock DB connection
         *
         * @param string $lockDb
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @throws DBError
         */
-       protected function initConnection( $lockDb, DatabaseBase $db ) {
+       protected function initConnection( $lockDb, IDatabase $db ) {
        }
 
        /**
@@ -254,9 +254,9 @@
 
        /**
         * @param string $lockDb
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         */
-       protected function initConnection( $lockDb, DatabaseBase $db ) {
+       protected function initConnection( $lockDb, IDatabase $db ) {
                # Let this transaction see lock rows from other transactions
                $db->query( "SET SESSION TRANSACTION ISOLATION LEVEL READ 
UNCOMMITTED;" );
        }
diff --git a/includes/filerepo/ForeignDBRepo.php 
b/includes/filerepo/ForeignDBRepo.php
index dfdb375..f3a560b 100644
--- a/includes/filerepo/ForeignDBRepo.php
+++ b/includes/filerepo/ForeignDBRepo.php
@@ -72,7 +72,7 @@
        }
 
        /**
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getMasterDB() {
                if ( !isset( $this->dbConn ) ) {
@@ -84,7 +84,7 @@
        }
 
        /**
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getSlaveDB() {
                return $this->getMasterDB();
diff --git a/includes/filerepo/ForeignDBViaLBRepo.php 
b/includes/filerepo/ForeignDBViaLBRepo.php
index f49b716..357f0b9 100644
--- a/includes/filerepo/ForeignDBViaLBRepo.php
+++ b/includes/filerepo/ForeignDBViaLBRepo.php
@@ -53,14 +53,14 @@
        }
 
        /**
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getMasterDB() {
                return wfGetDB( DB_MASTER, array(), $this->wiki );
        }
 
        /**
-        * @return DatabaseBase
+        * @return IDatabase
         */
        function getSlaveDB() {
                return wfGetDB( DB_SLAVE, array(), $this->wiki );
diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 1304362..7ce731d 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -485,7 +485,7 @@
                // Re-ping all masters with transactions. This throws DBError 
if some
                // connection died while waiting on locks/slaves, triggering a 
rollback.
                wfGetLBFactory()->forEachLB( function( LoadBalancer $lb ) use ( 
$fname ) {
-                       $lb->forEachOpenConnection( function( DatabaseBase 
$conn ) use ( $fname ) {
+                       $lb->forEachOpenConnection( function( IDatabase $conn ) 
use ( $fname ) {
                                if ( $conn->writesOrCallbacksPending() ) {
                                        $conn->query( "SELECT 1", $fname );
                                }
diff --git a/includes/libs/ObjectFactory.php b/includes/libs/ObjectFactory.php
index 1cb544b..0b9aa7c 100644
--- a/includes/libs/ObjectFactory.php
+++ b/includes/libs/ObjectFactory.php
@@ -45,7 +45,7 @@
         * Values in the arguments collection which are Closure instances will 
be
         * expanded by invoking them with no arguments before passing the
         * resulting value on to the constructor/callable. This can be used to
-        * pass DatabaseBase instances or other live objects to the
+        * pass IDatabase instances or other live objects to the
         * constructor/callable. This behavior can be suppressed by adding
         * closure_expansion => false to the specification.
         *
diff --git a/includes/objectcache/SqlBagOStuff.php 
b/includes/objectcache/SqlBagOStuff.php
index 91189c8..f634df1 100644
--- a/includes/objectcache/SqlBagOStuff.php
+++ b/includes/objectcache/SqlBagOStuff.php
@@ -127,7 +127,7 @@
         * Get a connection to the specified database
         *
         * @param int $serverIndex
-        * @return DatabaseBase
+        * @return IDatabase
         * @throws MWException
         */
        protected function getDB( $serverIndex ) {
@@ -482,7 +482,7 @@
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @param string $exptime
         * @return bool
         */
@@ -491,7 +491,7 @@
        }
 
        /**
-        * @param DatabaseBase $db
+        * @param IDatabase $db
         * @return string
         */
        protected function getMaxDateTime( $db ) {
diff --git a/includes/pager/IndexPager.php b/includes/pager/IndexPager.php
index 7a5952f..f0e7f3e 100644
--- a/includes/pager/IndexPager.php
+++ b/includes/pager/IndexPager.php
@@ -182,7 +182,7 @@
        /**
         * Get the Database object in use
         *
-        * @return DatabaseBase
+        * @return IDatabase
         */
        public function getDatabase() {
                return $this->mDb;
diff --git a/includes/utils/BatchRowIterator.php 
b/includes/utils/BatchRowIterator.php
index 59350e6..07cb2bc 100644
--- a/includes/utils/BatchRowIterator.php
+++ b/includes/utils/BatchRowIterator.php
@@ -26,7 +26,7 @@
 class BatchRowIterator implements RecursiveIterator {
 
        /**
-        * @var DatabaseBase $db The database to read from
+        * @var IDatabase $db The database to read from
         */
        protected $db;
 
@@ -58,7 +58,7 @@
 
        /**
         * @var array $fetchColumns List of column names to select from the
-        *  table suitable for use with DatabaseBase::select()
+        *  table suitable for use with IDatabase::select()
         */
        protected $fetchColumns;
 
@@ -98,7 +98,7 @@
 
        /**
         * @param array $condition Query conditions suitable for use with
-        *  DatabaseBase::select
+        *  IDatabase::select
         */
        public function addConditions( array $conditions ) {
                $this->conditions = array_merge( $this->conditions, $conditions 
);
@@ -106,7 +106,7 @@
 
        /**
         * @param array $condition Query join conditions suitable for use
-        *  with DatabaseBase::select
+        *  with IDatabase::select
         */
        public function addJoinConditions( array $conditions ) {
                $this->joinConditions = array_merge( $this->joinConditions, 
$conditions );
@@ -114,7 +114,7 @@
 
        /**
         * @param array $columns List of column names to select from the
-        *  table suitable for use with DatabaseBase::select()
+        *  table suitable for use with IDatabase::select()
         */
        public function setFetchColumns( array $columns ) {
                // If it's not the all column selector merge in the primary 
keys we need
diff --git a/includes/utils/BatchRowWriter.php 
b/includes/utils/BatchRowWriter.php
index 377ed85..13cab5b 100644
--- a/includes/utils/BatchRowWriter.php
+++ b/includes/utils/BatchRowWriter.php
@@ -22,7 +22,7 @@
  */
 class BatchRowWriter {
        /**
-        * @var DatabaseBase $db The database to write to
+        * @var IDatabase $db The database to write to
         */
        protected $db;
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8c8d85b32a8aba21e14d2a2dde4c25eb509186c1
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to