summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/Translate/scripts/sync-group.php')
-rw-r--r--MLEB/Translate/scripts/sync-group.php28
1 files changed, 14 insertions, 14 deletions
diff --git a/MLEB/Translate/scripts/sync-group.php b/MLEB/Translate/scripts/sync-group.php
index 5990eef1..dcd5f674 100644
--- a/MLEB/Translate/scripts/sync-group.php
+++ b/MLEB/Translate/scripts/sync-group.php
@@ -7,7 +7,7 @@
* @author Siebrand Mazeland
* @copyright Copyright © 2007-2013, Niklas Laxström
* @copyright Copyright © 2009-2013, Siebrand Mazeland
- * @license GPL-2.0+
+ * @license GPL-2.0-or-later
* @file
*/
@@ -85,13 +85,13 @@ class SyncGroup extends Maintenance {
$groups = MessageGroups::getGroupsById( $groupIds );
if ( !count( $groups ) ) {
- $this->error( "ESG2: No valid message groups identified.", 1 );
+ $this->error( 'ESG2: No valid message groups identified.', 1 );
}
$start = $this->getOption( 'start' ) ? strtotime( $this->getOption( 'start' ) ) : false;
$end = $this->getOption( 'end' ) ? strtotime( $this->getOption( 'end' ) ) : false;
- $this->output( "Conflict times: " . wfTimestamp( TS_ISO_8601, $start ) . " - " .
+ $this->output( 'Conflict times: ' . wfTimestamp( TS_ISO_8601, $start ) . ' - ' .
wfTimestamp( TS_ISO_8601, $end ) . "\n" );
$codes = array_filter( array_map( 'trim', explode( ',', $this->getOption( 'lang' ) ) ) );
@@ -115,7 +115,7 @@ class SyncGroup extends Maintenance {
foreach ( $codes as $code ) {
// No sync possible for unsupported language codes.
if ( !in_array( $code, $supportedCodes ) ) {
- $this->output( "Unsupported code " . $code . ": skipping.\n" );
+ $this->output( 'Unsupported code ' . $code . ": skipping.\n" );
continue;
}
@@ -130,7 +130,7 @@ class SyncGroup extends Maintenance {
}
$cs = new ChangeSyncer( $group, $this );
- $cs->setProgressCallback( array( $this, 'myOutput' ) );
+ $cs->setProgressCallback( [ $this, 'myOutput' ] );
$cs->interactive = !$this->hasOption( 'noask' );
$cs->nocolor = $this->hasOption( 'nocolor' );
$cs->norc = $this->hasOption( 'norc' );
@@ -161,7 +161,7 @@ class SyncGroup extends Maintenance {
* Public alternative for protected Maintenance::output() as we need to get
* messages from the ChangeSyncer class to the commandline.
* @param string $text The text to show to the user
- * @param string $channel Unique identifier for the channel.
+ * @param string|null $channel Unique identifier for the channel.
* @param bool $error Whether this is an error message
*/
public function myOutput( $text, $channel = null, $error = false ) {
@@ -227,7 +227,7 @@ class ChangeSyncer {
return false;
}
- $matches = array();
+ $matches = [];
// PHP doesn't allow foo || return false;
// Thank
// you
@@ -299,7 +299,7 @@ class ChangeSyncer {
}
// @todo Temporary exception. Should be fixed elsewhere more generically.
- if ( $translation == '{{PLURAL:GETTEXT|}}' ) {
+ if ( $translation === '{{PLURAL:GETTEXT|}}' ) {
return;
}
@@ -319,7 +319,7 @@ class ChangeSyncer {
continue;
}
- $this->reportProgress( "Conflict in " . $this->color( 'bold', $page ) . "!", $page );
+ $this->reportProgress( 'Conflict in ' . $this->color( 'bold', $page ) . '!', $page );
$iso = 'xnY-xnm-xnd"T"xnH:xni:xns';
$lang = RequestContext::getMain()->getLanguage();
@@ -350,10 +350,10 @@ class ChangeSyncer {
if ( $changeTs ) {
if ( $wikiTs > $startTs && $changeTs <= $endTs ) {
- $this->reportProgress( " →Changed in wiki after export: IGNORE", $page );
+ $this->reportProgress( ' →Changed in wiki after export: IGNORE', $page );
continue;
} elseif ( !$wikiTs || ( $changeTs > $endTs && $wikiTs < $startTs ) ) {
- $this->reportProgress( " →Changed in source after export: IMPORT", $page );
+ $this->reportProgress( ' →Changed in source after export: IMPORT', $page );
$this->import(
$title,
$translation,
@@ -367,14 +367,14 @@ class ChangeSyncer {
continue;
}
- $this->reportProgress( " →Needs manual resolution", $page );
+ $this->reportProgress( ' →Needs manual resolution', $page );
$this->reportProgress( "Source translation at $changeDate:", 'source' );
$this->reportProgress( $this->color( 'blue', $translation ), 'source' );
$this->reportProgress( "Wiki translation at $wikiDate:", 'translation' );
$this->reportProgress( $this->color( 'green', $current ), 'translation' );
do {
- $this->reportProgress( "Resolution: [S]kip [I]mport [C]onflict: ", 'foo' );
+ $this->reportProgress( 'Resolution: [S]kip [I]mport [C]onflict: ', 'foo' );
// @todo Find an elegant way to use Maintenance::readconsole().
$action = fgets( STDIN );
$action = strtoupper( trim( $action ) );
@@ -440,7 +440,7 @@ class ChangeSyncer {
break;
}
- if ( $revision->getRawUserText() === $wgTranslateFuzzyBotName ) {
+ if ( $revision->getUserText( Revision::RAW ) === $wgTranslateFuzzyBotName ) {
$revision = $revision->getPrevious();
continue;
}