Siebrand has uploaded a new change for review.
https://gerrit.wikimedia.org/r/63290
Change subject: Update formatting
......................................................................
Update formatting
Change-Id: I8fdd9ba8826fa206a4c7146b743b8896a56845b8
---
M MessageCollection.php
M MessageGroups.php
M Resources.php
M TranslateEditAddons.php
M TranslateTasks.php
M TranslateUtils.php
M api/ApiQueryMessageGroups.php
M api/ApiTranslateSandbox.php
M ffs/AndroidXmlFFS.php
M ffs/GettextFFS.php
M ffs/JavaFFS.php
M ffs/JsonFFS.php
M ffs/MediaWikiComplexMessages.php
M ffs/XliffFFS.php
M messagegroups/AggregateMessageGroup.php
M messagegroups/CoreMessageGroup.php
M messagegroups/MessageGroupBase.php
M messagegroups/MessageGroupOld.php
M messagegroups/RecentMessageGroup.php
M messagegroups/SingleFileBasedMessageGroup.php
M messagegroups/WorkflowStatesMessageGroup.php
M resources/css/ext.translate.special.managegroups.css
M resources/css/ext.translate.special.supportedlanguages.css
M scripts/migrate-schema2.php
M scripts/poimport.php
M specials/SpecialImportTranslations.php
M specials/SpecialLanguageStats.php
M specials/SpecialManageGroups.php
M specials/SpecialMessageGroupStats.php
M specials/SpecialSearchTranslations.php
M specials/SpecialTranslate.php
M specials/SpecialTranslateSandbox.php
M specials/SpecialTranslationStats.php
M tag/PageTranslationHooks.php
M tag/TranslateDeleteJob.php
M tests/MessageGroupStatesUpdaterJobTest.php
M tests/SolrTTMServerTest.php
M tests/TPParseTest.php
M tests/ffs/AndroidXmlFFSTest.php
M translationaids/InOtherLanguagesAid.php
M ttmserver/DatabaseTTMServer.php
M ttmserver/FakeTTMServer.php
M utils/MessageGroupStats.php
M utils/MessageIndex.php
M utils/MessageTable.php
M utils/TranslationHelpers.php
M webservices/TranslationWebServiceException.php
47 files changed, 145 insertions(+), 105 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate
refs/changes/90/63290/1
diff --git a/MessageCollection.php b/MessageCollection.php
index ec29c72..c785a8a 100644
--- a/MessageCollection.php
+++ b/MessageCollection.php
@@ -233,7 +233,8 @@
/**
* @deprecated 2013-01-18 enabled by default
*/
- public function setReviewMode( $value = true ) {}
+ public function setReviewMode( $value = true ) {
+ }
// Data modifiers
diff --git a/MessageGroups.php b/MessageGroups.php
index 2258c4e..a37b708 100644
--- a/MessageGroups.php
+++ b/MessageGroups.php
@@ -197,7 +197,7 @@
* @return bool
*/
public static function exists( $id ) {
- return (bool)self::getGroup( $id );
+ return (bool) self::getGroup( $id );
}
/**
@@ -384,7 +384,8 @@
return $paths;
}
- private function __construct() {}
+ private function __construct() {
+ }
/**
* Constructor function.
@@ -451,7 +452,7 @@
public static function expandWildcards( $ids ) {
$all = array();
- $matcher = new StringMatcher( '', (array)$ids );
+ $matcher = new StringMatcher( '', (array) $ids );
foreach ( self::getAllGroups() as $id => $_ ) {
if ( $matcher->match( $id ) ) {
$all[] = $id;
diff --git a/Resources.php b/Resources.php
index aea1f78..57dbea7 100644
--- a/Resources.php
+++ b/Resources.php
@@ -345,8 +345,7 @@
'jquery.uls.grid',
'jquery.ui.dialog',
),
- 'messages' => array(
- ),
+ 'messages' => array(),
) + $resourcePaths;
$wgResourceModules['ext.translate.special.translationstats'] = array(
diff --git a/TranslateEditAddons.php b/TranslateEditAddons.php
index 37afc96..7239142 100644
--- a/TranslateEditAddons.php
+++ b/TranslateEditAddons.php
@@ -258,7 +258,7 @@
$groupId = $request->getText( 'loadgroup', '' );
$th = new TranslationHelpers( $editpage->getTitle(), $groupId );
if ( $editpage->firsttime && !$request->getCheck( 'oldid' ) &&
!$request->getCheck( 'undo' ) ) {
- $editpage->textbox1 = (string)$th->getTranslation();
+ $editpage->textbox1 = (string) $th->getTranslation();
} else {
$th->setTranslation( $editpage->textbox1 );
}
@@ -309,10 +309,11 @@
public static function keepFields( EditPage $editpage, OutputPage $out
) {
$request = $editpage->getArticle()->getContext()->getRequest();
- $out->addHTML( "\n" .
- Html::hidden( 'loadgroup', $request->getText(
'loadgroup' ) ) .
- Html::hidden( 'loadtask', $request->getText( 'loadtask'
) ) .
- "\n"
+ $out->addHTML(
+ "\n" .
+ Html::hidden( 'loadgroup', $request->getText(
'loadgroup' ) ) .
+ Html::hidden( 'loadtask', $request->getText(
'loadtask' ) ) .
+ "\n"
);
return true;
diff --git a/TranslateTasks.php b/TranslateTasks.php
index 3e4230a..19b04a4 100644
--- a/TranslateTasks.php
+++ b/TranslateTasks.php
@@ -158,11 +158,14 @@
class CustomFilteredMessagesTask extends TranslateTask {
protected $id = 'custom';
- protected function preinit() {}
+ protected function preinit() {
+ }
- protected function postinit() {}
+ protected function postinit() {
+ }
- protected function doPaging() {}
+ protected function doPaging() {
+ }
protected function output() {
$table = new TuxMessageTable( $this->context, $this->group,
$this->options['language'] );
@@ -299,7 +302,8 @@
}
// No paging should be done.
- protected function doPaging() {}
+ protected function doPaging() {
+ }
public function output() {
if ( $this->group instanceof MessageGroupBase ) {
diff --git a/TranslateUtils.php b/TranslateUtils.php
index d41bd49..8caa84a 100644
--- a/TranslateUtils.php
+++ b/TranslateUtils.php
@@ -240,7 +240,7 @@
$normkey = self::normaliseKey( $namespace, $key );
if ( isset( $mi[$normkey] ) ) {
- return (array)$mi[$normkey];
+ return (array) $mi[$normkey];
} else {
return array();
}
diff --git a/api/ApiQueryMessageGroups.php b/api/ApiQueryMessageGroups.php
index ca277ca..484b1bc 100644
--- a/api/ApiQueryMessageGroups.php
+++ b/api/ApiQueryMessageGroups.php
@@ -300,7 +300,9 @@
'priorityforce' => ' priorityforce - Include priority
status - is the priority languages setting forced',
'workflowstates' => ' workflowstates - Include the
workflow states for the message group',
);
+
wfRunHooks( 'TranslateGetAPIMessageGroupsPropertyDescs', array(
&$properties ) );
+
return $properties;
}
diff --git a/api/ApiTranslateSandbox.php b/api/ApiTranslateSandbox.php
index a9c0c54..62b0ca4 100644
--- a/api/ApiTranslateSandbox.php
+++ b/api/ApiTranslateSandbox.php
@@ -21,18 +21,18 @@
$params = $this->extractRequestParams();
switch ( $params['do'] ) {
- case 'create':
- $this->doCreate();
- break;
- case 'delete':
- $this->doDelete();
- break;
- case 'promote':
- $this->doPromote();
- break;
- case 'remind':
- $this->doRemind();
- break;
+ case 'create':
+ $this->doCreate();
+ break;
+ case 'delete':
+ $this->doDelete();
+ break;
+ case 'promote':
+ $this->doPromote();
+ break;
+ case 'remind':
+ $this->doRemind();
+ break;
}
}
diff --git a/ffs/AndroidXmlFFS.php b/ffs/AndroidXmlFFS.php
index 2d8775b..4db7ad9 100644
--- a/ffs/AndroidXmlFFS.php
+++ b/ffs/AndroidXmlFFS.php
@@ -28,10 +28,10 @@
$mangler = $this->group->getMangler();
foreach ( $reader->string as $string ) {
- $key = (string)$string['name'];
- $value = stripcslashes( (string)$string );
+ $key = (string) $string['name'];
+ $value = stripcslashes( (string) $string );
- if ( isset( $string['fuzzy'] ) &&
(string)$string['fuzzy'] === 'true' ) {
+ if ( isset( $string['fuzzy'] ) && (string)
$string['fuzzy'] === 'true' ) {
$value = TRANSLATE_FUZZY . $value;
}
diff --git a/ffs/GettextFFS.php b/ffs/GettextFFS.php
index 9570c22..fc8d094 100644
--- a/ffs/GettextFFS.php
+++ b/ffs/GettextFFS.php
@@ -12,7 +12,8 @@
/**
* Identifies Gettext plural exceptions.
*/
-class GettextPluralException extends MwException {}
+class GettextPluralException extends MwException {
+}
/**
* New-style FFS class that implements support for gettext file format.
diff --git a/ffs/JavaFFS.php b/ffs/JavaFFS.php
index e724042..8551b5c 100644
--- a/ffs/JavaFFS.php
+++ b/ffs/JavaFFS.php
@@ -30,6 +30,7 @@
$this->keySeparator = $this->extra['keySeparator'];
}
}
+
// READ
/**
diff --git a/ffs/JsonFFS.php b/ffs/JsonFFS.php
index 240a41d..890d91a 100644
--- a/ffs/JsonFFS.php
+++ b/ffs/JsonFFS.php
@@ -39,7 +39,7 @@
$metadata = array();
if ( isset( $messages['@metadata']['authors'] ) ) {
- $authors = (array)$messages['@metadata']['authors'];
+ $authors = (array) $messages['@metadata']['authors'];
unset( $messages['@metadata']['authors'] );
}
diff --git a/ffs/MediaWikiComplexMessages.php b/ffs/MediaWikiComplexMessages.php
index e5fb11e..a9774cc 100644
--- a/ffs/MediaWikiComplexMessages.php
+++ b/ffs/MediaWikiComplexMessages.php
@@ -221,7 +221,7 @@
}
if ( $group['code'] ) {
- $data = (array)@${$group['var']} [$code];
+ $data = (array) @${$group['var']} [$code];
} else {
$data = ${$group['var']};
}
@@ -413,7 +413,7 @@
public function validate( &$errors = array(), $filter = false ) {
$used = array();
foreach ( array_keys( $this->data ) as $group ) {
- if ( $filter !== false && !in_array( $group,
(array)$filter, true ) ) {
+ if ( $filter !== false && !in_array( $group, (array)
$filter, true ) ) {
continue;
}
@@ -449,7 +449,7 @@
foreach ( $errors as $_ ) $text .= "#!!# $_\n";
foreach ( $this->getGroups() as $group => $data ) {
- if ( $filter !== false && !in_array( $group,
(array)$filter, true ) ) {
+ if ( $filter !== false && !in_array( $group, (array)
$filter, true ) ) {
continue;
}
diff --git a/ffs/XliffFFS.php b/ffs/XliffFFS.php
index 5098e50..a6e5320 100644
--- a/ffs/XliffFFS.php
+++ b/ffs/XliffFFS.php
@@ -26,7 +26,7 @@
continue;
}
- $key = (string)$item['id'];
+ $key = (string) $item['id'];
/* In case there are tags inside the element, preserve
* them. */
@@ -38,7 +38,7 @@
* for now if there is explicit approved=no, mark it
* as fuzzy, but don't do that if the attribute is not
* set */
- if ( (string)$source['state'] === 'needs-l10n' ) {
+ if ( (string) $source['state'] === 'needs-l10n' ) {
$value = TRANSLATE_FUZZY . $value;
}
@@ -72,7 +72,7 @@
public static function getInnerXml( DomElement $node ) {
$text = '';
foreach ( $node->childNodes as $child ) {
- $text .= $child->ownerDocument->saveXML( $child
);
+ $text .= $child->ownerDocument->saveXML( $child );
}
return $text;
}
diff --git a/messagegroups/AggregateMessageGroup.php
b/messagegroups/AggregateMessageGroup.php
index e8158bd..8939563 100644
--- a/messagegroups/AggregateMessageGroup.php
+++ b/messagegroups/AggregateMessageGroup.php
@@ -18,7 +18,7 @@
class AggregateMessageGroup extends MessageGroupBase {
public function exists() {
// Group exists if there are any subgroups.
- $exists = (bool)$this->conf['GROUPS'];
+ $exists = (bool) $this->conf['GROUPS'];
return $exists;
}
@@ -46,7 +46,7 @@
public function getGroups() {
if ( !isset( $this->groups ) ) {
$groups = array();
- $ids = (array)$this->conf['GROUPS'];
+ $ids = (array) $this->conf['GROUPS'];
$ids = MessageGroups::expandWildcards( $ids );
foreach ( $ids as $id ) {
diff --git a/messagegroups/CoreMessageGroup.php
b/messagegroups/CoreMessageGroup.php
index bb385e8..e02f1aa 100644
--- a/messagegroups/CoreMessageGroup.php
+++ b/messagegroups/CoreMessageGroup.php
@@ -115,7 +115,7 @@
$file = $this->getMessageFileWithPath( $code );
// Can return null, convert to array.
$mangler = $this->getMangler();
- $messages = (array)$mangler->mangle(
+ $messages = (array) $mangler->mangle(
PHPVariableLoader::loadVariableFromPHPFile( $file,
'messages' )
);
diff --git a/messagegroups/MessageGroupBase.php
b/messagegroups/MessageGroupBase.php
index ab0ab2c..e375f73 100644
--- a/messagegroups/MessageGroupBase.php
+++ b/messagegroups/MessageGroupBase.php
@@ -28,7 +28,8 @@
*/
protected $mangler;
- protected function __construct() {}
+ protected function __construct() {
+ }
/**
* @param $conf
diff --git a/messagegroups/MessageGroupOld.php
b/messagegroups/MessageGroupOld.php
index d5dc64f..15cfb0c 100644
--- a/messagegroups/MessageGroupOld.php
+++ b/messagegroups/MessageGroupOld.php
@@ -311,7 +311,8 @@
return $collection;
}
- public function __construct() {}
+ public function __construct() {
+ }
/**
* Can be overwritten to retun false if something is wrong.
@@ -347,8 +348,11 @@
}
// Unsupported stuff, just to satisfy the new interface
- public function setConfiguration( $conf ) {}
- public function getConfiguration() {}
+ public function setConfiguration( $conf ) {
+ }
+
+ public function getConfiguration() {
+ }
public function getFFS() {
return null;
diff --git a/messagegroups/RecentMessageGroup.php
b/messagegroups/RecentMessageGroup.php
index 82bfefc..4394241 100644
--- a/messagegroups/RecentMessageGroup.php
+++ b/messagegroups/RecentMessageGroup.php
@@ -26,7 +26,8 @@
* These groups are always generated for one language. Method
setLanguage
* must be called before calling getDefinitions.
*/
- public function __construct() {}
+ public function __construct() {
+ }
public function setLanguage( $code ) {
$this->language = $code;
diff --git a/messagegroups/SingleFileBasedMessageGroup.php
b/messagegroups/SingleFileBasedMessageGroup.php
index 1260d94..38af99d 100644
--- a/messagegroups/SingleFileBasedMessageGroup.php
+++ b/messagegroups/SingleFileBasedMessageGroup.php
@@ -23,4 +23,5 @@
*
* @ingroup MessageGroup
*/
-class SingleFileBasedMessageGroup extends FileBasedMessageGroup {}
+class SingleFileBasedMessageGroup extends FileBasedMessageGroup {
+}
diff --git a/messagegroups/WorkflowStatesMessageGroup.php
b/messagegroups/WorkflowStatesMessageGroup.php
index e7f9d70..a073625 100644
--- a/messagegroups/WorkflowStatesMessageGroup.php
+++ b/messagegroups/WorkflowStatesMessageGroup.php
@@ -14,7 +14,8 @@
*/
class WorkflowStatesMessageGroup extends WikiMessageGroup {
// id and source are not needed
- public function __construct() {}
+ public function __construct() {
+ }
public function getId() {
return 'translate-workflow-states';
diff --git a/resources/css/ext.translate.special.managegroups.css
b/resources/css/ext.translate.special.managegroups.css
index 1480994..cc2302e 100644
--- a/resources/css/ext.translate.special.managegroups.css
+++ b/resources/css/ext.translate.special.managegroups.css
@@ -18,4 +18,4 @@
font-size: 200%;
font-family: Verdana, sans-serif;
font-weight: bold;
-}
\ No newline at end of file
+}
diff --git a/resources/css/ext.translate.special.supportedlanguages.css
b/resources/css/ext.translate.special.supportedlanguages.css
index 036d3a1..7cca22d 100644
--- a/resources/css/ext.translate.special.supportedlanguages.css
+++ b/resources/css/ext.translate.special.supportedlanguages.css
@@ -17,4 +17,4 @@
white-space: nowrap;
margin: 0.5ex;
color: black;
-}
\ No newline at end of file
+}
diff --git a/scripts/migrate-schema2.php b/scripts/migrate-schema2.php
index 785ac0b..cdc394c 100644
--- a/scripts/migrate-schema2.php
+++ b/scripts/migrate-schema2.php
@@ -60,7 +60,7 @@
$dbw->update(
'revtag',
array( 'rt_type' => $row->rtt_name ),
- array( 'rt_type' => (string)$row->rtt_id ),
+ array( 'rt_type' => (string) $row->rtt_id ),
__METHOD__
);
}
diff --git a/scripts/poimport.php b/scripts/poimport.php
index 349d92b..424ea7e 100644
--- a/scripts/poimport.php
+++ b/scripts/poimport.php
@@ -151,7 +151,7 @@
$translation = TRANSLATE_FUZZY . $translation;
}
- $oldtranslation =
(string)$contents[$key]->translation();
+ $oldtranslation = (string)
$contents[$key]->translation();
if ( $translation !== $oldtranslation ) {
if ( $translation === '' ) {
diff --git a/specials/SpecialImportTranslations.php
b/specials/SpecialImportTranslations.php
index 028c58f..2c393c1 100644
--- a/specials/SpecialImportTranslations.php
+++ b/specials/SpecialImportTranslations.php
@@ -141,7 +141,7 @@
$class = array( 'class' => 'mw-translate-import-inputs' );
- if( $wgTranslateAllowImportFromUrl === true ) {
+ if ( $wgTranslateAllowImportFromUrl === true ) {
$this->getOutput()->addHTML(
Xml::radioLabel( $this->msg(
'translate-import-from-url' )->text(),
'upload-type', 'url',
'mw-translate-up-url',
diff --git a/specials/SpecialLanguageStats.php
b/specials/SpecialLanguageStats.php
index 6554bcc..031929b 100644
--- a/specials/SpecialLanguageStats.php
+++ b/specials/SpecialLanguageStats.php
@@ -120,11 +120,11 @@
}
if ( isset( $params[1] ) ) {
- $this->noComplete = (bool)$params[1];
+ $this->noComplete = (bool) $params[1];
}
if ( isset( $params[2] ) ) {
- $this->noEmpty = (bool)$params[2];
+ $this->noEmpty = (bool) $params[2];
}
// Whether the form has been submitted, only relevant if not
including
diff --git a/specials/SpecialManageGroups.php b/specials/SpecialManageGroups.php
index d9bc6ec..53811c4 100644
--- a/specials/SpecialManageGroups.php
+++ b/specials/SpecialManageGroups.php
@@ -82,11 +82,12 @@
$this->diff = $diff;
$out = $this->getOutput();
- $out->addHtml( '' .
- Html::openElement( 'form', array( 'method' => 'post' )
) .
- Html::hidden( 'title',
$this->getTitle()->getPrefixedText() ) .
- Html::hidden( 'token', $this->getUser()->getEditToken()
) .
- $this->getLegend()
+ $out->addHtml(
+ '' .
+ Html::openElement( 'form', array( 'method' =>
'post' ) ) .
+ Html::hidden( 'title',
$this->getTitle()->getPrefixedText() ) .
+ Html::hidden( 'token',
$this->getUser()->getEditToken() ) .
+ $this->getLegend()
);
$counter = 0;
diff --git a/specials/SpecialMessageGroupStats.php
b/specials/SpecialMessageGroupStats.php
index 611feb6..2de681e 100644
--- a/specials/SpecialMessageGroupStats.php
+++ b/specials/SpecialMessageGroupStats.php
@@ -52,7 +52,7 @@
$this->target = $group->getId();
}
}
- return (bool)$group;
+ return (bool) $group;
}
/// Overwritten from SpecialLanguageStats
diff --git a/specials/SpecialSearchTranslations.php
b/specials/SpecialSearchTranslations.php
index 39db611..8c68d1e 100644
--- a/specials/SpecialSearchTranslations.php
+++ b/specials/SpecialSearchTranslations.php
@@ -102,7 +102,7 @@
$facet = $resultset->getFacetSet()->getFacet( 'group' );
$facets .= Html::element( 'div',
array( 'class' => 'row facet groups',
- 'data-facets' => FormatJson::encode(
$this->getGroups( $facet) ),
+ 'data-facets' => FormatJson::encode(
$this->getGroups( $facet ) ),
'data-group' => $opts->getValue( 'group' ), ),
$this->msg( 'tux-sst-facet-group' )
);
diff --git a/specials/SpecialTranslate.php b/specials/SpecialTranslate.php
index 33d8975..843a4a8 100644
--- a/specials/SpecialTranslate.php
+++ b/specials/SpecialTranslate.php
@@ -272,13 +272,13 @@
foreach ( $defaults as $v => $t ) {
if ( is_bool( $t ) ) {
- $r = isset( $pars[$v] ) ? (bool)$pars[$v] :
$defaults[$v];
+ $r = isset( $pars[$v] ) ? (bool) $pars[$v] :
$defaults[$v];
$r = $request->getBool( $v, $r );
} elseif ( is_int( $t ) ) {
- $r = isset( $pars[$v] ) ? (int)$pars[$v] :
$defaults[$v];
+ $r = isset( $pars[$v] ) ? (int) $pars[$v] :
$defaults[$v];
$r = $request->getInt( $v, $r );
} elseif ( is_string( $t ) ) {
- $r = isset( $pars[$v] ) ? (string)$pars[$v] :
$defaults[$v];
+ $r = isset( $pars[$v] ) ? (string) $pars[$v] :
$defaults[$v];
$r = $request->getText( $v, $r );
}
diff --git a/specials/SpecialTranslateSandbox.php
b/specials/SpecialTranslateSandbox.php
index 126b552..9c84521 100644
--- a/specials/SpecialTranslateSandbox.php
+++ b/specials/SpecialTranslateSandbox.php
@@ -81,7 +81,7 @@
$timestamp = new MWTimestamp( $data['registration'] );
$agoEnc = htmlspecialchars( $timestamp->getHumanTimestamp() );
- return <<<HTML
+ return <<<HTML
<div class="row request" data-data="$dataEnc">
<div class="three columns amount">
<div class="proofread-marker"></div>
diff --git a/specials/SpecialTranslationStats.php
b/specials/SpecialTranslationStats.php
index a1a84cc..78d185c 100644
--- a/specials/SpecialTranslationStats.php
+++ b/specials/SpecialTranslationStats.php
@@ -455,7 +455,7 @@
continue;
}
- foreach ( (array)$indexLabels as $i ) {
+ foreach ( (array) $indexLabels as $i ) {
if ( !isset( $labelToIndex[$i] ) ) {
continue;
@@ -650,7 +650,7 @@
* @return int Rounded number.
*/
public static function roundToSignificant( $number, $significant = 1 ) {
- $log = (int)log( $number, 10 );
+ $log = (int) log( $number, 10 );
$nonSignificant = max( 0, $log - $significant + 1 );
$factor = pow( 10, $nonSignificant );
return intval( ceil( $number / $factor ) * $factor );
diff --git a/tag/PageTranslationHooks.php b/tag/PageTranslationHooks.php
index df555b5..49e80c3 100644
--- a/tag/PageTranslationHooks.php
+++ b/tag/PageTranslationHooks.php
@@ -387,7 +387,7 @@
* Hook: ArticleSave, PageContentSave
*/
public static function tpSyntaxCheck( $wikiPage, $user, $content,
$summary,
- $minor, $_, $_, $flags, $status
+ $minor, $_, $_, $flags, $status
) {
if ( $content instanceof TextContent ) {
$text = $content->getNativeData();
@@ -419,7 +419,7 @@
* Hook: ArticleSaveComplete, PageContentSaveComplete
*/
public static function addTranstag( $wikiPage, $user, $content,
$summary,
- $minor, $_, $_, $flags, $revision
+ $minor, $_, $_, $flags, $revision
) {
// We are not interested in null revisions
if ( $revision === null ) {
diff --git a/tag/TranslateDeleteJob.php b/tag/TranslateDeleteJob.php
index eadea05..29120f1 100644
--- a/tag/TranslateDeleteJob.php
+++ b/tag/TranslateDeleteJob.php
@@ -73,7 +73,7 @@
PageTranslationHooks::$allowTargetEdit = false;
$cache = wfGetCache( CACHE_DB );
- $pages = (array)$cache->get( wfMemcKey( 'pt-base', $base ) );
+ $pages = (array) $cache->get( wfMemcKey( 'pt-base', $base ) );
$lastitem = array_pop( $pages );
if ( $title->getPrefixedText() === $lastitem ) {
$cache->delete( wfMemcKey( 'pt-base', $base ) );
diff --git a/tests/MessageGroupStatesUpdaterJobTest.php
b/tests/MessageGroupStatesUpdaterJobTest.php
index 7773b4a..2a9521e 100644
--- a/tests/MessageGroupStatesUpdaterJobTest.php
+++ b/tests/MessageGroupStatesUpdaterJobTest.php
@@ -167,7 +167,8 @@
}
class MockMessageHandle extends MessageHandle {
- public function __construct() {}
+ public function __construct() {
+ }
public function getGroupIds() {
return array( 'group-trans', 'group-notrans' );
diff --git a/tests/SolrTTMServerTest.php b/tests/SolrTTMServerTest.php
index 85662b3..f748815 100644
--- a/tests/SolrTTMServerTest.php
+++ b/tests/SolrTTMServerTest.php
@@ -76,7 +76,8 @@
$result = $solarium->select( $select );
$this->assertEquals( 1, $result->getNumFound() );
$doc = null;
- foreach ( $result as $doc ) {}
+ foreach ( $result as $doc ) {
+ }
$this->assertEquals( wfWikiId(), $doc->wiki );
$this->assertEquals( 'en', $doc->language );
$this->assertEquals( '1', $doc->content );
@@ -93,7 +94,8 @@
$result = $solarium->select( $select );
$this->assertEquals( 1, $result->getNumFound() );
$doc = null;
- foreach ( $result as $doc ) {}
+ foreach ( $result as $doc ) {
+ }
$this->assertEquals( 'yksi', $doc->content );
$this->assertEquals( array( 'ttmserver-test' ), $doc->group );
@@ -127,7 +129,8 @@
$result = $solarium->select( $select );
$this->assertEquals( 1, $result->getNumFound() );
$doc = null;
- foreach ( $result as $doc ) {}
+ foreach ( $result as $doc ) {
+ }
$this->assertEquals( 'yksi-päiv', $doc->content );
// And now the messages should be orphaned
diff --git a/tests/TPParseTest.php b/tests/TPParseTest.php
index 05f879d..5e005de 100644
--- a/tests/TPParseTest.php
+++ b/tests/TPParseTest.php
@@ -30,13 +30,13 @@
$message->setTranslation( $section->getText() );
$collection[$key] = $message;
}
+
$actual = $parse->getTranslationPageText( $collection );
$this->assertEquals( $expected, $actual, 'Variable declarations
are substituted in source language' );
-
foreach ( $parse->sections as $section ) {
$key = $prefix . $section->id;
- $message = new FatMessage( $key, $section->getText() );
+ $message = new FatMessage( $key, $section->getText() );
$message->setTranslation( $section->getTextForTrans() );
$collection[$key] = $message;
}
diff --git a/tests/ffs/AndroidXmlFFSTest.php b/tests/ffs/AndroidXmlFFSTest.php
index 851b397..d633c40 100644
--- a/tests/ffs/AndroidXmlFFSTest.php
+++ b/tests/ffs/AndroidXmlFFSTest.php
@@ -82,5 +82,6 @@
$this->messages['foobar']->addTag( 'fuzzy' );
}
- public function filter( $type, $condition = true, $value = null ) {}
+ public function filter( $type, $condition = true, $value = null ) {
+ }
}
diff --git a/translationaids/InOtherLanguagesAid.php
b/translationaids/InOtherLanguagesAid.php
index 62a795d..d96ab89 100644
--- a/translationaids/InOtherLanguagesAid.php
+++ b/translationaids/InOtherLanguagesAid.php
@@ -63,7 +63,7 @@
// Global configuration settings
$fallbacks = array();
if ( isset( $wgTranslateLanguageFallbacks[$code] ) ) {
- $fallbacks =
(array)$wgTranslateLanguageFallbacks[$code];
+ $fallbacks = (array)
$wgTranslateLanguageFallbacks[$code];
}
$list = Language::getFallbacksFor( $code );
diff --git a/ttmserver/DatabaseTTMServer.php b/ttmserver/DatabaseTTMServer.php
index 6433515..aa99912 100644
--- a/ttmserver/DatabaseTTMServer.php
+++ b/ttmserver/DatabaseTTMServer.php
@@ -181,7 +181,8 @@
wfWaitForSlaves( 10 );
}
- public function endBatch() {}
+ public function endBatch() {
+ }
public function endBootstrap() {
$dbw = $this->getDB( DB_MASTER );
diff --git a/ttmserver/FakeTTMServer.php b/ttmserver/FakeTTMServer.php
index 0c91b98..46a1d68 100644
--- a/ttmserver/FakeTTMServer.php
+++ b/ttmserver/FakeTTMServer.php
@@ -29,11 +29,24 @@
return '';
}
- public function update( MessageHandle $handle, $targetText ) {}
- public function beginBootstrap() {}
- public function beginBatch() {}
- public function batchInsertDefinitions( array $batch ) {}
- public function batchInsertTranslations( array $batch ) {}
- public function endBatch() {}
- public function endBootstrap() {}
+ public function update( MessageHandle $handle, $targetText ) {
+ }
+
+ public function beginBootstrap() {
+ }
+
+ public function beginBatch() {
+ }
+
+ public function batchInsertDefinitions( array $batch ) {
+ }
+
+ public function batchInsertTranslations( array $batch ) {
+ }
+
+ public function endBatch() {
+ }
+
+ public function endBootstrap() {
+ }
}
diff --git a/utils/MessageGroupStats.php b/utils/MessageGroupStats.php
index 47254dd..6cd7c82 100644
--- a/utils/MessageGroupStats.php
+++ b/utils/MessageGroupStats.php
@@ -210,10 +210,10 @@
*/
protected static function extractNumbers( $row ) {
return array(
- self::TOTAL => (int)$row->tgs_total,
- self::TRANSLATED => (int)$row->tgs_translated,
- self::FUZZY => (int)$row->tgs_fuzzy,
- self::PROOFREAD => (int)$row->tgs_proofread,
+ self::TOTAL => (int) $row->tgs_total,
+ self::TRANSLATED => (int) $row->tgs_translated,
+ self::FUZZY => (int) $row->tgs_fuzzy,
+ self::PROOFREAD => (int) $row->tgs_proofread,
);
}
diff --git a/utils/MessageIndex.php b/utils/MessageIndex.php
index 2960467..3ff7ae4 100644
--- a/utils/MessageIndex.php
+++ b/utils/MessageIndex.php
@@ -46,7 +46,7 @@
$value = self::singleton()->get( $normkey );
if ( $value !== null ) {
- return (array)$value;
+ return (array) $value;
} else {
return array();
}
@@ -140,15 +140,15 @@
foreach ( $new as $key => $groups ) {
// Using != here on purpose to ignore order of items
if ( !isset( $old[$key] ) ) {
- $changes[$key] = array( array(), (array)$groups
);
+ $changes[$key] = array( array(), (array)
$groups );
} elseif ( $groups != $old[$key] ) {
- $changes[$key] = array( (array)$old[$key],
(array)$groups );
+ $changes[$key] = array( (array) $old[$key],
(array) $groups );
}
}
foreach ( $old as $key => $groups ) {
if ( !isset( $new[$key] ) ) {
- $changes[$key] = array( (array)$groups, array()
);
+ $changes[$key] = array( (array) $groups,
array() );
}
// We already checked for diffs above
}
@@ -206,7 +206,7 @@
$key = TranslateUtils::normaliseKey( $namespace, $key );
if ( isset( $hugearray[$key] ) ) {
if ( !$ignore ) {
- $to = implode( ', ',
(array)$hugearray[$key] );
+ $to = implode( ', ', (array)
$hugearray[$key] );
STDERR( "Key $key already belongs to
$to, conflict with $id" );
}
@@ -437,7 +437,7 @@
}
wfProfileIn( __METHOD__ );
- $keys = (array)$this->unserialize( $reader->get( '#keys' ) );
+ $keys = (array) $this->unserialize( $reader->get( '#keys' ) );
$this->index = array();
foreach ( $keys as $key ) {
$this->index[$key] = $this->unserialize( $reader->get(
$key ) );
diff --git a/utils/MessageTable.php b/utils/MessageTable.php
index e7347be..57fdfa3 100644
--- a/utils/MessageTable.php
+++ b/utils/MessageTable.php
@@ -292,7 +292,7 @@
'name' => 'acceptbutton-' . $revision, // Otherwise
Firefox disables buttons on page load
);
- $reviewers = (array)$message->getProperty( 'reviewers' );
+ $reviewers = (array) $message->getProperty( 'reviewers' );
if ( in_array( $wgUser->getId(), $reviewers ) ) {
$attribs['value'] = wfMessage(
'translate-messagereview-done' )->text();
$attribs['disabled'] = 'disabled';
@@ -323,7 +323,7 @@
return '';
}
- $reviewers = (array)$message->getProperty( 'reviewers' );
+ $reviewers = (array) $message->getProperty( 'reviewers' );
$count = count( $reviewers );
if ( $count === 0 ) {
return '';
diff --git a/utils/TranslationHelpers.php b/utils/TranslationHelpers.php
index 5dd64ac..cd2e5ff 100644
--- a/utils/TranslationHelpers.php
+++ b/utils/TranslationHelpers.php
@@ -175,11 +175,11 @@
if ( $suggestions === 'async' ) {
$all['translation-memory'] = array( $this,
'getLazySuggestionBox' );
} elseif ( $suggestions === 'only' ) {
- return (string)$this->callBox( 'translation-memory',
$all['translation-memory'], array( 'lazy' ) );
+ return (string) $this->callBox( 'translation-memory',
$all['translation-memory'], array( 'lazy' ) );
} elseif ( $suggestions === 'checks' ) {
global $wgRequest;
$this->translation = $wgRequest->getText( 'translation'
);
- return (string)$this->callBox( 'check', $all['check'] );
+ return (string) $this->callBox( 'check', $all['check']
);
}
if ( $this->group instanceof RecentMessageGroup ) {
@@ -1167,7 +1167,7 @@
// Global configuration settings
$fallbacks = array();
if ( isset( $wgTranslateLanguageFallbacks[$code] ) ) {
- $fallbacks =
(array)$wgTranslateLanguageFallbacks[$code];
+ $fallbacks = (array)
$wgTranslateLanguageFallbacks[$code];
}
$list = Language::getFallbacksFor( $code );
@@ -1401,4 +1401,5 @@
* - mustHaveDefinition()
* @since 2012-01-04 (Renamed in 2012-07-24 to fix typo in name)
*/
-class TranslationHelperException extends MWException {}
+class TranslationHelperException extends MWException {
+}
diff --git a/webservices/TranslationWebServiceException.php
b/webservices/TranslationWebServiceException.php
index ff2ea8c..c5e962a 100644
--- a/webservices/TranslationWebServiceException.php
+++ b/webservices/TranslationWebServiceException.php
@@ -14,4 +14,5 @@
* @since 2013-01-01
* @ingroup TranslationWebService
*/
-class TranslationWebServiceException extends MWException {}
+class TranslationWebServiceException extends MWException {
+}
--
To view, visit https://gerrit.wikimedia.org/r/63290
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8fdd9ba8826fa206a4c7146b743b8896a56845b8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits