From: Aaron Schulz Date: Mon, 24 Oct 2016 05:03:37 +0000 (-0700) Subject: Small DB classes IDEA warning fixes and cleanups X-Git-Tag: 1.31.0-rc.0~5037^2 X-Git-Url: https://git.cyclocoop.org/admin/%7B%7Blocalurl:Special:UserLogin%7D%7D?a=commitdiff_plain;h=d1215eb7a50e8886b0db8745859fc05f8ee92de8;p=lhc%2Fweb%2Fwiklou.git Small DB classes IDEA warning fixes and cleanups Change-Id: I65b5f452a364b329bb671540f4115dbc4f40eebd --- diff --git a/includes/libs/rdbms/database/DatabasePostgres.php b/includes/libs/rdbms/database/DatabasePostgres.php index 016b9cda8c..7acd8dce7b 100644 --- a/includes/libs/rdbms/database/DatabasePostgres.php +++ b/includes/libs/rdbms/database/DatabasePostgres.php @@ -1087,7 +1087,7 @@ __INDEXATTR__; if ( !is_array( $types ) ) { $types = [ $types ]; } - if ( !$schema ) { + if ( $schema === false ) { $schema = $this->getCoreSchema(); } $table = $this->realTableName( $table, 'raw' ); @@ -1236,7 +1236,6 @@ SQL; function strencode( $s ) { // Should not be called by us - return pg_escape_string( $this->getBindingHandle(), $s ); } diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 1cb5eefe87..208cf1769c 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -104,7 +104,7 @@ abstract class Maintenance { /** * Used by getDB() / setDB() - * @var IDatabase + * @var Database */ private $mDb = null; @@ -726,6 +726,7 @@ abstract class Maintenance { if ( is_array( $wgProfiler ) && isset( $wgProfiler['class'] ) ) { $class = $wgProfiler['class']; + /** @var Profiler $profiler */ $profiler = new $class( [ 'sampling' => 1, 'output' => [ $output ] ] + $wgProfiler @@ -1182,6 +1183,7 @@ abstract class Maintenance { $this->beginTransaction( $dbw, __METHOD__ ); # Get "active" text records from the revisions table + $cur = []; $this->output( 'Searching for active text records in revisions table...' ); $res = $dbw->select( 'revision', 'rev_text_id', [], __METHOD__, [ 'DISTINCT' ] ); foreach ( $res as $row ) { diff --git a/maintenance/update.php b/maintenance/update.php index b96e7eb871..a672e294e7 100755 --- a/maintenance/update.php +++ b/maintenance/update.php @@ -145,6 +145,7 @@ class UpdateMediaWiki extends Maintenance { $this->output( "Going to run database updates for " . wfWikiID() . "\n" ); if ( $db->getType() === 'sqlite' ) { + /** @var Database|DatabaseSqlite $db */ $this->output( "Using SQLite file: '{$db->getDbFilePath()}'\n" ); } $this->output( "Depending on the size of your database this may take a while!\n" );