From 0f7893f87724e7762f47cbd0e70063d06b2b393b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sun, 4 Oct 2015 02:07:25 -0700 Subject: [PATCH] Update various @params from DatabaseBase to IDatabase Change-Id: I98e44cdffb0fc0d729f69f702799139afb988c20 --- includes/Block.php | 4 +-- includes/Export.php | 2 +- includes/Revision.php | 26 +++++++++---------- includes/RevisionList.php | 4 +-- includes/SiteStats.php | 4 +-- includes/Title.php | 2 +- includes/UserRightsProxy.php | 2 +- includes/api/ApiBase.php | 2 +- includes/api/ApiPageSet.php | 2 +- includes/cache/BacklinkCache.php | 2 +- includes/cache/LinkBatch.php | 2 +- includes/changetags/ChangeTagsLogList.php | 2 +- .../changetags/ChangeTagsRevisionList.php | 2 +- includes/deferred/SiteStatsUpdate.php | 2 +- includes/externalstore/ExternalStoreDB.php | 2 +- includes/filerepo/file/LocalFile.php | 2 +- includes/logging/LogEventsList.php | 2 +- includes/page/WikiPage.php | 14 +++++----- includes/search/SearchDatabase.php | 6 ++--- includes/utils/BatchRowIterator.php | 4 +-- includes/utils/BatchRowWriter.php | 4 +-- 21 files changed, 46 insertions(+), 46 deletions(-) diff --git a/includes/Block.php b/includes/Block.php index c5a16fcea6..0ec4ad1400 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -452,7 +452,7 @@ class Block { * Insert a block into the block table. Will fail if there is a conflicting * block (same name and options) already in the database. * - * @param DatabaseBase $dbw If you have one available + * @param IDatabase $dbw If you have one available * @return bool|array False on failure, assoc array on success: * ('id' => block ID, 'autoIds' => array of autoblock IDs) */ @@ -556,7 +556,7 @@ class Block { /** * Get an array suitable for passing to $dbw->insert() or $dbw->update() - * @param DatabaseBase $db + * @param IDatabase $db * @return array */ protected function getDatabaseArray( $db = null ) { diff --git a/includes/Export.php b/includes/Export.php index adab21c32c..b4d77379e8 100644 --- a/includes/Export.php +++ b/includes/Export.php @@ -79,7 +79,7 @@ class WikiExporter { * make additional queries to pull source data while the * main query is still running. * - * @param DatabaseBase $db + * @param IDatabase $db * @param int|array $history One of WikiExporter::FULL, WikiExporter::CURRENT, * WikiExporter::RANGE or WikiExporter::STABLE, or an associative array: * - offset: non-inclusive offset at which to start the query diff --git a/includes/Revision.php b/includes/Revision.php index a7a87e8cbc..24c025f6c0 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -223,7 +223,7 @@ class Revision implements IDBAccessObject { * Load a page revision from a given revision ID number. * Returns null if no such revision can be found. * - * @param DatabaseBase $db + * @param IDatabase $db * @param int $id * @return Revision|null */ @@ -236,7 +236,7 @@ class Revision implements IDBAccessObject { * that's attached to a given page. If not attached * to that page, will return null. * - * @param DatabaseBase $db + * @param IDatabase $db * @param int $pageid * @param int $id * @return Revision|null @@ -256,7 +256,7 @@ class Revision implements IDBAccessObject { * that's attached to a given page. If not attached * to that page, will return null. * - * @param DatabaseBase $db + * @param IDatabase $db * @param Title $title * @param int $id * @return Revision|null @@ -281,7 +281,7 @@ class Revision implements IDBAccessObject { * WARNING: Timestamps may in some circumstances not be unique, * so this isn't the best key to use. * - * @param DatabaseBase $db + * @param IDatabase $db * @param Title $title * @param string $timestamp * @return Revision|null @@ -333,7 +333,7 @@ class Revision implements IDBAccessObject { * Given a set of conditions, fetch a revision from * the given database connection. * - * @param DatabaseBase $db + * @param IDatabase $db * @param array $conditions * @param int $flags (optional) * @return Revision|null @@ -375,7 +375,7 @@ class Revision implements IDBAccessObject { * which will return matching database rows with the * fields necessary to build Revision objects. * - * @param DatabaseBase $db + * @param IDatabase $db * @param array $conditions * @param int $flags (optional) * @return ResultWrapper @@ -519,7 +519,7 @@ class Revision implements IDBAccessObject { /** * Do a batched query to get the parent revision lengths - * @param DatabaseBase $db + * @param IDatabase $db * @param array $revIds * @return array */ @@ -1206,7 +1206,7 @@ class Revision implements IDBAccessObject { * Get previous revision Id for this page_id * This is used to populate rev_parent_id on save * - * @param DatabaseBase $db + * @param IDatabase $db * @return int */ private function getPreviousRevisionId( $db ) { @@ -1359,7 +1359,7 @@ class Revision implements IDBAccessObject { * Insert a new revision into the database, returning the new revision ID * number on success and dies horribly on failure. * - * @param DatabaseBase $dbw (master connection) + * @param IDatabase $dbw (master connection) * @throws MWException * @return int */ @@ -1596,7 +1596,7 @@ class Revision implements IDBAccessObject { * Such revisions can for instance identify page rename * operations and other such meta-modifications. * - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @param int $pageId ID number of the page to read from * @param string $summary Revision's summary * @param bool $minor Whether the revision should be considered as minor @@ -1746,7 +1746,7 @@ class Revision implements IDBAccessObject { /** * Get count of revisions per page...not very efficient * - * @param DatabaseBase $db + * @param IDatabase $db * @param int $id Page id * @return int */ @@ -1762,7 +1762,7 @@ class Revision implements IDBAccessObject { /** * Get count of revisions per page...not very efficient * - * @param DatabaseBase $db + * @param IDatabase $db * @param Title $title * @return int */ @@ -1782,7 +1782,7 @@ class Revision implements IDBAccessObject { * @since 1.20 * @deprecated since 1.24 * - * @param DatabaseBase|int $db The Database to perform the check on. May be given as a + * @param IDatabase|int $db The Database to perform the check on. May be given as a * Database object or a database identifier usable with wfGetDB. * @param int $pageId The ID of the page in question * @param int $userId The ID of the user in question diff --git a/includes/RevisionList.php b/includes/RevisionList.php index e4174730d1..1df0ca0a98 100644 --- a/includes/RevisionList.php +++ b/includes/RevisionList.php @@ -121,7 +121,7 @@ abstract class RevisionListBase extends ContextSource { /** * Do the DB query to iterate through the objects. - * @param DatabaseBase $db DatabaseBase object to use for the query + * @param IDatabase $db DatabaseBase object to use for the query */ abstract public function doQuery( $db ); @@ -264,7 +264,7 @@ class RevisionList extends RevisionListBase { } /** - * @param DatabaseBase $db + * @param IDatabase $db * @return mixed */ public function doQuery( $db ) { diff --git a/includes/SiteStats.php b/includes/SiteStats.php index 81172a14f7..64e5ea027b 100644 --- a/includes/SiteStats.php +++ b/includes/SiteStats.php @@ -98,7 +98,7 @@ class SiteStats { } /** - * @param DatabaseBase $db + * @param IDatabase $db * @return bool|ResultWrapper */ static function doLoad( $db ) { @@ -364,7 +364,7 @@ class SiteStatsInit { * Do all updates and commit them. More or less a replacement * for the original initStats, but without output. * - * @param DatabaseBase|bool $database + * @param IDatabase|bool $database * - Boolean: whether to use the master DB * - DatabaseBase: database connection to use * @param array $options Array of options, may contain the following values diff --git a/includes/Title.php b/includes/Title.php index eac712bede..27fbf03982 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -4430,7 +4430,7 @@ class Title { /** * Get the last touched timestamp * - * @param DatabaseBase $db Optional db + * @param IDatabase $db Optional db * @return string Last-touched timestamp */ public function getTouched( $db = null ) { diff --git a/includes/UserRightsProxy.php b/includes/UserRightsProxy.php index 2c7032f45f..0d1708f314 100644 --- a/includes/UserRightsProxy.php +++ b/includes/UserRightsProxy.php @@ -31,7 +31,7 @@ class UserRightsProxy { * * @see newFromId() * @see newFromName() - * @param DatabaseBase $db Db connection + * @param IDatabase $db Db connection * @param string $database Database name * @param string $name User name * @param int $id User ID diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index f5ceb33586..1465543a48 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -2820,7 +2820,7 @@ abstract class ApiBase extends ContextSource { /** * @deprecated since 1.25, always returns empty string - * @param DatabaseBase|bool $db + * @param IDatabase|bool $db * @return string */ public function getModuleProfileName( $db = false ) { diff --git a/includes/api/ApiPageSet.php b/includes/api/ApiPageSet.php index ceb0905bc8..17c148e25f 100644 --- a/includes/api/ApiPageSet.php +++ b/includes/api/ApiPageSet.php @@ -701,7 +701,7 @@ class ApiPageSet extends ApiBase { * Note that the query result must include the columns returned by * $this->getPageTableFields(). * - * @param DatabaseBase $db + * @param IDatabase $db * @param ResultWrapper $queryResult Query result object */ public function populateFromQueryResult( $db, $queryResult ) { diff --git a/includes/cache/BacklinkCache.php b/includes/cache/BacklinkCache.php index 1296c136f7..549ac84018 100644 --- a/includes/cache/BacklinkCache.php +++ b/includes/cache/BacklinkCache.php @@ -133,7 +133,7 @@ class BacklinkCache { /** * Set the Database object to use * - * @param DatabaseBase $db + * @param IDatabase $db */ public function setDB( $db ) { $this->db = $db; diff --git a/includes/cache/LinkBatch.php b/includes/cache/LinkBatch.php index 698b3046f3..d98888f0b0 100644 --- a/includes/cache/LinkBatch.php +++ b/includes/cache/LinkBatch.php @@ -231,7 +231,7 @@ class LinkBatch { * Construct a WHERE clause which will match all the given titles. * * @param string $prefix The appropriate table's field name prefix ('page', 'pl', etc) - * @param DatabaseBase $db DatabaseBase object to use + * @param IDatabase $db DatabaseBase object to use * @return string|bool String with SQL where clause fragment, or false if no items. */ public function constructSet( $prefix, $db ) { diff --git a/includes/changetags/ChangeTagsLogList.php b/includes/changetags/ChangeTagsLogList.php index 4526ee31da..3bffbdf663 100644 --- a/includes/changetags/ChangeTagsLogList.php +++ b/includes/changetags/ChangeTagsLogList.php @@ -29,7 +29,7 @@ class ChangeTagsLogList extends ChangeTagsList { } /** - * @param DatabaseBase $db + * @param IDatabase $db * @return mixed */ public function doQuery( $db ) { diff --git a/includes/changetags/ChangeTagsRevisionList.php b/includes/changetags/ChangeTagsRevisionList.php index ec401bc87d..f0dfc0f4db 100644 --- a/includes/changetags/ChangeTagsRevisionList.php +++ b/includes/changetags/ChangeTagsRevisionList.php @@ -29,7 +29,7 @@ class ChangeTagsRevisionList extends ChangeTagsList { } /** - * @param DatabaseBase $db + * @param IDatabase $db * @return mixed */ public function doQuery( $db ) { diff --git a/includes/deferred/SiteStatsUpdate.php b/includes/deferred/SiteStatsUpdate.php index ae75a7549c..d135a80457 100644 --- a/includes/deferred/SiteStatsUpdate.php +++ b/includes/deferred/SiteStatsUpdate.php @@ -125,7 +125,7 @@ class SiteStatsUpdate implements DeferrableUpdate { } /** - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @return bool|mixed */ public static function cacheUpdate( $dbw ) { diff --git a/includes/externalstore/ExternalStoreDB.php b/includes/externalstore/ExternalStoreDB.php index 952bf63b25..cc70960fe3 100644 --- a/includes/externalstore/ExternalStoreDB.php +++ b/includes/externalstore/ExternalStoreDB.php @@ -156,7 +156,7 @@ class ExternalStoreDB extends ExternalStoreMedium { /** * Get the 'blobs' table name for this database * - * @param DatabaseBase $db + * @param IDatabase $db * @return string Table name ('blobs' by default) */ function getTable( $db ) { diff --git a/includes/filerepo/file/LocalFile.php b/includes/filerepo/file/LocalFile.php index d1467084fe..1bccf81c55 100644 --- a/includes/filerepo/file/LocalFile.php +++ b/includes/filerepo/file/LocalFile.php @@ -433,7 +433,7 @@ class LocalFile extends File { } /** - * @param DatabaseBase $dbr + * @param IDatabase $dbr * @param string $fname * @return array|bool */ diff --git a/includes/logging/LogEventsList.php b/includes/logging/LogEventsList.php index 1b56584f85..4c0bd8ef98 100644 --- a/includes/logging/LogEventsList.php +++ b/includes/logging/LogEventsList.php @@ -646,7 +646,7 @@ class LogEventsList extends ContextSource { /** * SQL clause to skip forbidden log types for this user * - * @param DatabaseBase $db + * @param IDatabase $db * @param string $audience Public/user * @param User $user User to check, or null to use $wgUser * @return string|bool String on success, false on failure. diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php index d3978eac7f..ffb5b9e0ae 100644 --- a/includes/page/WikiPage.php +++ b/includes/page/WikiPage.php @@ -298,7 +298,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Fetch a page record with the given conditions - * @param DatabaseBase $dbr + * @param IDatabase $dbr * @param array $conditions * @param array $options * @return object|bool Database result resource, or false on failure @@ -319,7 +319,7 @@ class WikiPage implements Page, IDBAccessObject { * Fetch a page record matching the Title object's namespace and title * using a sanitized title string * - * @param DatabaseBase $dbr + * @param IDatabase $dbr * @param Title $title * @param array $options * @return object|bool Database result resource, or false on failure @@ -333,7 +333,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Fetch a page record matching the requested ID * - * @param DatabaseBase $dbr + * @param IDatabase $dbr * @param int $id * @param array $options * @return object|bool Database result resource, or false on failure @@ -1194,7 +1194,7 @@ class WikiPage implements Page, IDBAccessObject { * or else the record will be left in a funky state. * Best if all done inside a transaction. * - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @return int|bool The newly created page_id key; false if the title already existed */ public function insertOn( $dbw ) { @@ -1228,7 +1228,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Update the page record to point to a newly saved revision. * - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @param Revision $revision For ID number, and text used to set * length and redirect status fields * @param int $lastRevision If given, will not overwrite the page field @@ -1295,7 +1295,7 @@ class WikiPage implements Page, IDBAccessObject { /** * Add row to the redirect table if this is a redirect, remove otherwise. * - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @param Title $redirectTitle Title object pointing to the redirect target, * or NULL if this is not a redirect * @param null|bool $lastRevIsRedirect If given, will optimize adding and @@ -1334,7 +1334,7 @@ class WikiPage implements Page, IDBAccessObject { * * @deprecated since 1.24, use updateRevisionOn instead * - * @param DatabaseBase $dbw + * @param IDatabase $dbw * @param Revision $revision * @return bool */ diff --git a/includes/search/SearchDatabase.php b/includes/search/SearchDatabase.php index 82d09073bc..5b18b7c82b 100644 --- a/includes/search/SearchDatabase.php +++ b/includes/search/SearchDatabase.php @@ -28,15 +28,15 @@ */ class SearchDatabase extends SearchEngine { /** - * @var DatabaseBase Slave database for reading from for results + * @var IDatabase Slave database for reading from for results */ protected $db; /** * Constructor - * @param DatabaseBase $db The database to search from + * @param IDatabase $db The database to search from */ - public function __construct( DatabaseBase $db = null ) { + public function __construct( IDatabase $db = null ) { if ( $db ) { $this->db = $db; } else { diff --git a/includes/utils/BatchRowIterator.php b/includes/utils/BatchRowIterator.php index fb2ae2a3cd..59350e6fe9 100644 --- a/includes/utils/BatchRowIterator.php +++ b/includes/utils/BatchRowIterator.php @@ -78,13 +78,13 @@ class BatchRowIterator implements RecursiveIterator { private $key; /** - * @param DatabaseBase $db The database to read from + * @param IDatabase $db The database to read from * @param string $table The name of the table to read from * @param string|array $primaryKey The name or names of the primary key columns * @param integer $batchSize The number of rows to fetch per iteration * @throws MWException */ - public function __construct( DatabaseBase $db, $table, $primaryKey, $batchSize ) { + public function __construct( IDatabase $db, $table, $primaryKey, $batchSize ) { if ( $batchSize < 1 ) { throw new MWException( 'Batch size must be at least 1 row.' ); } diff --git a/includes/utils/BatchRowWriter.php b/includes/utils/BatchRowWriter.php index 04c00a3dce..377ed852d5 100644 --- a/includes/utils/BatchRowWriter.php +++ b/includes/utils/BatchRowWriter.php @@ -37,11 +37,11 @@ class BatchRowWriter { protected $clusterName; /** - * @param DatabaseBase $db The database to write to + * @param IDatabase $db The database to write to * @param string $table The name of the table to update * @param string|bool $clusterName A cluster name valid for use with LBFactory */ - public function __construct( DatabaseBase $db, $table, $clusterName = false ) { + public function __construct( IDatabase $db, $table, $clusterName = false ) { $this->db = $db; $this->table = $table; $this->clusterName = $clusterName; -- 2.20.1