jenkins-bot has submitted this change and it was merged.
Change subject: JS and PHP code style fixes
......................................................................
JS and PHP code style fixes
if( -> if (
for( -> for (
else if -> elseif
Lines greater than 120 chars chomped.
Change-Id: I909d4fe9785a656481878256830ae5965e48a416
---
M ApiVisualEditor.php
M demos/ve/index.php
M modules/unicodejs/unicodejs.wordbreak.js
3 files changed, 15 insertions(+), 11 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php
index c7c2da7..0613535 100644
--- a/ApiVisualEditor.php
+++ b/ApiVisualEditor.php
@@ -42,12 +42,12 @@
if ( $status->isOK() ) {
$content = $req->getContent();
- } else if ( $status->isGood() ) {
+ } elseif ( $status->isGood() ) {
$this->dieUsage( $req->getContent(),
'parsoidserver-http-'.$req->getStatus() );
- } else if ( $errors = $status->getErrorsByType( 'error'
) ) {
+ } elseif ( $errors = $status->getErrorsByType( 'error'
) ) {
$error = $errors[0];
$code = $error['message'];
- if( count( $error['params'] ) ) {
+ if ( count( $error['params'] ) ) {
$message = $error['params'][0];
} else {
$message = 'MWHttpRequest error';
@@ -284,7 +284,7 @@
if ( $wikitext === false ) {
$this->dieUsage( 'Error contacting the
Parsoid server', 'parsoidserver' );
- } else if ( $params['paction'] === 'save' ) {
+ } elseif ( $params['paction'] === 'save' ) {
// Save page
$editResult = $this->saveWikitext(
$page, $wikitext, $params );
if (
@@ -311,7 +311,7 @@
$result['newrevid'] =
intval( $editResult['edit']['newrevid'] );
}
}
- } else if ( $params['paction'] === 'diff' ) {
+ } elseif ( $params['paction'] === 'diff' ) {
$diff = $this->diffWikitext( $page,
$wikitext );
if ( $diff['result'] === 'fail' ) {
$this->dieUsage( 'Diff failed',
'difffailed' );
@@ -371,12 +371,15 @@
return array(
'page' => 'The page to perform actions on.',
'paction' => 'Action to perform',
- 'oldid' => 'The revision number to use. If zero, the
empty string is passed to Parsoid to indicate new page creation.',
+ 'oldid' => 'The revision number to use. If zero, the
empty string is passed to Parsoid'
+ .' to indicate new page creation.',
'minor' => 'Flag for minor edit.',
'html' => 'HTML to send to parsoid in exchange for
wikitext',
'summary' => 'Edit summary',
- 'basetimestamp' => 'When saving, set this to the
timestamp of the revision that was edited. Used to detect edit conflicts.',
- 'starttimestamp' => 'When saving, set this to the
timestamp of when the page was loaded. Used to detect edit conflicts.',
+ 'basetimestamp' => 'When saving, set this to the
timestamp of the revision that was'
+ .' edited. Used to detect edit conflicts.',
+ 'starttimestamp' => 'When saving, set this to the
timestamp of when the page was loaded.'
+ .' Used to detect edit conflicts.',
'token' => 'Edit token',
);
}
diff --git a/demos/ve/index.php b/demos/ve/index.php
index 7630192..fce8f83 100644
--- a/demos/ve/index.php
+++ b/demos/ve/index.php
@@ -71,7 +71,8 @@
<?php echo basename( $page,
'.html' ); ?>
</a>
</li>
- <?php endforeach; ?>
+ <?php
+ endforeach; ?>
</ul>
<div class="ve-demo-editor"></div>
@@ -441,7 +442,7 @@
var getKids = function ( obj ) {
var $ol = $( '<ol start="0"></ol>' ),
$li;
- for( var i = 0; i <
obj.children.length; i++ ) {
+ for ( var i = 0; i <
obj.children.length; i++ ) {
$li = $( '<li>' );
$label = $( '<span>'
).addClass( 've-demo-dump-element' );
if ( obj.children[i].length !==
undefined ) {
diff --git a/modules/unicodejs/unicodejs.wordbreak.js
b/modules/unicodejs/unicodejs.wordbreak.js
index 910038d..9349b20 100644
--- a/modules/unicodejs/unicodejs.wordbreak.js
+++ b/modules/unicodejs/unicodejs.wordbreak.js
@@ -79,7 +79,7 @@
// Check previous character was alpha-numeric
if required
if ( onlyAlphaNumeric ) {
lastGroup = getGroup( string.read( i -
direction + readCharOffset ) );
- if( lastGroup !== 'ALetter' &&
lastGroup !== 'Numeric' && lastGroup !== 'Katakana' ) {
+ if ( lastGroup !== 'ALetter' &&
lastGroup !== 'Numeric' && lastGroup !== 'Katakana' ) {
continue;
}
}
--
To view, visit https://gerrit.wikimedia.org/r/65994
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I909d4fe9785a656481878256830ae5965e48a416
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Esanders <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits