/** @var bool */
protected $hasSharedCache;
- # Other stuff
+ /** @var IDatabase */
protected $dbConn;
- protected $fileFactory = array( 'ForeignDBFile', 'newFromTitle' );
- protected $fileFromRowFactory = array( 'ForeignDBFile', 'newFromRow' );
+
+ /** @var callable */
+ protected $fileFactory = [ 'ForeignDBFile', 'newFromTitle' ];
+ /** @var callable */
+ protected $fileFromRowFactory = [ 'ForeignDBFile', 'newFromRow' ];
/**
* @param array|null $info
}
/**
- * @return DatabaseBase
+ * @return IDatabase
*/
function getMasterDB() {
if ( !isset( $this->dbConn ) ) {
}
/**
- * @return DatabaseBase
+ * @return IDatabase
*/
function getSlaveDB() {
return $this->getMasterDB();
* @return Closure
*/
protected function getDBFactory() {
- return function( $index ) {
- return DatabaseBase::factory( $this->dbType,
- array(
- 'host' => $this->dbServer,
- 'user' => $this->dbUser,
- 'password' => $this->dbPassword,
- 'dbname' => $this->dbName,
- 'flags' => $this->dbFlags,
- 'tablePrefix' => $this->tablePrefix,
- 'foreign' => true,
- )
- );
+ $type = $this->dbType;
+ $params = [
+ 'host' => $this->dbServer,
+ 'user' => $this->dbUser,
+ 'password' => $this->dbPassword,
+ 'dbname' => $this->dbName,
+ 'flags' => $this->dbFlags,
+ 'tablePrefix' => $this->tablePrefix,
+ 'foreign' => true,
+ ];
+
+ return function ( $index ) use ( $type, $params ) {
+ return Database::factory( $type, $params );
};
}