summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Translate/scripts/createCheckIndex.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/wiki/extensions/Translate/scripts/createCheckIndex.php')
-rw-r--r--www/wiki/extensions/Translate/scripts/createCheckIndex.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/www/wiki/extensions/Translate/scripts/createCheckIndex.php b/www/wiki/extensions/Translate/scripts/createCheckIndex.php
index 618d7148..6b6f4296 100644
--- a/www/wiki/extensions/Translate/scripts/createCheckIndex.php
+++ b/www/wiki/extensions/Translate/scripts/createCheckIndex.php
@@ -5,7 +5,7 @@
* @author Niklas Laxström
* @author Siebrand Mazeland
* @copyright Copyright © 2008-2013, Niklas Laxström, Siebrand Mazeland
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @file
*/
@@ -87,7 +87,7 @@ class CreateCheckIndex extends Maintenance {
foreach ( $langCodes as $code ) {
$this->output( "$code ", $id );
- $problematic = array();
+ $problematic = [];
$collection->resetForNewLanguage( $code );
$collection->loadTranslations();
@@ -97,7 +97,6 @@ class CreateCheckIndex extends Maintenance {
foreach ( $collection as $key => $message ) {
$prob = $checker->checkMessageFast( $message, $code );
if ( $prob ) {
-
if ( $verbose ) {
// Print it
$nsText = $wgContLang->getNsText( $g->namespaces[0] );
@@ -105,7 +104,7 @@ class CreateCheckIndex extends Maintenance {
}
// Add it to the array
- $problematic[] = array( $g->namespaces[0], "$key/$code" );
+ $problematic[] = [ $g->namespaces[0], "$key/$code" ];
}
}
@@ -123,21 +122,21 @@ class CreateCheckIndex extends Maintenance {
foreach ( $problematic as $p ) {
$title = Title::makeTitleSafe( $p[0], $p[1] );
$titleText = $title->getDBkey();
- $res = $dbw->select( 'page', array( 'page_id', 'page_latest' ),
- array( 'page_namespace' => $p[0], 'page_title' => $titleText ), __METHOD__ );
+ $res = $dbw->select( 'page', [ 'page_id', 'page_latest' ],
+ [ 'page_namespace' => $p[0], 'page_title' => $titleText ], __METHOD__ );
- $inserts = array();
+ $inserts = [];
foreach ( $res as $r ) {
- $inserts = array(
+ $inserts = [
'rt_page' => $r->page_id,
'rt_revision' => $r->page_latest,
'rt_type' => RevTag::getType( 'fuzzy' )
- );
+ ];
}
$dbw->replace( 'revtag', 'rt_type_page_revision', $inserts, __METHOD__ );
}
}
}
-$maintClass = 'CreateCheckIndex';
+$maintClass = CreateCheckIndex::class;
require_once RUN_MAINTENANCE_IF_MAIN;