jenkins-bot has submitted this change and it was merged.

Change subject: Fix CodeSniffer errors and warnings
......................................................................


Fix CodeSniffer errors and warnings

Change-Id: I442b4e55521089ab64b049c8087985af202515dd
---
M Interwiki.php
M Interwiki_body.php
2 files changed, 81 insertions(+), 22 deletions(-)

Approvals:
  Nikerabbit: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/Interwiki.php b/Interwiki.php
index 6b99f99..f15bb29 100644
--- a/Interwiki.php
+++ b/Interwiki.php
@@ -30,7 +30,16 @@
 $wgExtensionCredits['specialpage'][] = array(
        'path' => __FILE__,
        'name' => 'Interwiki',
-       'author' => array( 'Stephanie Amanda Stevens', 'Alexandre Emsenhuber', 
'Robin Pepermans', 'Siebrand Mazeland', 'Platonides', 'Raimond Spekking', 'Sam 
Reed', '...' ),
+       'author' => array(
+               'Stephanie Amanda Stevens',
+               'Alexandre Emsenhuber',
+               'Robin Pepermans',
+               'Siebrand Mazeland',
+               'Platonides',
+               'Raimond Spekking',
+               'Sam Reed',
+               '...'
+       ),
        'version' => '2.2 20120425',
        'url' => 'https://www.mediawiki.org/wiki/Extension:Interwiki',
        'descriptionmsg' => 'interwiki-desc',
@@ -68,7 +77,7 @@
                // Set up the new log type - interwiki actions are logged to 
this new log
                $wgLogTypes[] = 'interwiki';
                # interwiki, iw_add, iw_delete, iw_edit
-               $wgLogActionsHandlers['interwiki/*']  = 'InterwikiLogFormatter';
+               $wgLogActionsHandlers['interwiki/*'] = 'InterwikiLogFormatter';
        }
 
        return true;
diff --git a/Interwiki_body.php b/Interwiki_body.php
index 3325771..ec10496 100644
--- a/Interwiki_body.php
+++ b/Interwiki_body.php
@@ -50,7 +50,9 @@
                case 'submit':
                        if ( !$this->canModify( $out ) ) {
                                # Error msg added by canModify()
-                       } elseif ( !$request->wasPosted() || 
!$this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) ) ) {
+                       } elseif ( !$request->wasPosted() ||
+                               !$this->getUser()->matchEditToken( 
$request->getVal( 'wpEditToken' ) )
+                       ) {
                                // Prevent cross-site request forgeries
                                $out->addWikiMsg( 'sessionfailure' );
                        } else {
@@ -146,22 +148,49 @@
                        $formContent = Html::rawElement( 'tr', null,
                                Html::element( 'td', $label, $this->msg( 
'interwiki-prefix-label' )->text() ) .
                                Html::rawElement( 'td', null, '<tt>' . 
$prefixElement . '</tt>' )
+                       ) . Html::rawElement(
+                               'tr',
+                               null,
+                               Html::rawElement(
+                                       'td',
+                                       $label,
+                                       Xml::label( $this->msg( 
'interwiki-local-label' )->text(), 'mw-interwiki-local' )
+                               ) .
+                               Html::rawElement(
+                                       'td',
+                                       $input,
+                                       Xml::check( 'wpInterwikiLocal', $local, 
array( 'id' => 'mw-interwiki-local' ) )
+                               )
                        ) . Html::rawElement( 'tr', null,
-                               Html::rawElement( 'td', $label, Xml::label( 
$this->msg( 'interwiki-local-label' )->text(), 'mw-interwiki-local' ) ) .
-                               Html::rawElement( 'td', $input, Xml::check( 
'wpInterwikiLocal', $local, array( 'id' => 'mw-interwiki-local' ) ) )
+                               Html::rawElement(
+                                       'td',
+                                       $label,
+                                       Xml::label( $this->msg( 
'interwiki-trans-label' )->text(), 'mw-interwiki-trans' )
+                               ) .
+                               Html::rawElement(
+                                       'td',
+                                       $input,  Xml::check( 
'wpInterwikiTrans', $trans, array( 'id' => 'mw-interwiki-trans' ) ) )
                        ) . Html::rawElement( 'tr', null,
-                               Html::rawElement( 'td', $label, Xml::label( 
$this->msg( 'interwiki-trans-label' )->text(), 'mw-interwiki-trans' ) ) .
-                               Html::rawElement( 'td', $input,  Xml::check( 
'wpInterwikiTrans', $trans, array( 'id' => 'mw-interwiki-trans' ) ) )
-                       ) . Html::rawElement( 'tr', null,
-                               Html::rawElement( 'td', $label, Xml::label( 
$this->msg( 'interwiki-url-label' )->text(), 'mw-interwiki-url' ) ) .
+                               Html::rawElement(
+                                       'td',
+                                       $label,
+                                       Xml::label( $this->msg( 
'interwiki-url-label' )->text(), 'mw-interwiki-url' )
+                               ) .
                                Html::rawElement( 'td', $input, Xml::input( 
'wpInterwikiURL', 60, $defaulturl,
                                        array( 'tabindex' => 1, 'maxlength' => 
200, 'id' => 'mw-interwiki-url' ) ) )
                        );
                }
 
-               $form = Xml::fieldset( $topmessage, Html::rawElement( 'form',
-                       array( 'id' => "mw-interwiki-{$action}form", 'method' 
=> 'post',
-                               'action' => $this->getTitle()->getLocalUrl( 
array( 'action' => 'submit', 'prefix' => $prefix ) ) ),
+               $form = Xml::fieldset( $topmessage, Html::rawElement(
+                       'form',
+                       array(
+                               'id' => "mw-interwiki-{$action}form",
+                               'method' => 'post',
+                               'action' => $this->getTitle()->getLocalUrl( 
array(
+                                       'action' => 'submit',
+                                       'prefix' => $prefix
+                               ) )
+                       ),
                        Html::rawElement( 'p', null, $intromessage ) .
                        Html::rawElement( 'table', array( 'id' => 
"mw-interwiki-{$action}" ),
                                $formContent . Html::rawElement( 'tr', null,
@@ -313,16 +342,25 @@
                        return;
                }
 
-               $out = '';
-
                # Output the existing Interwiki prefixes table header
-               $out .= Html::openElement( 'table', array( 'class' => 
'mw-interwikitable wikitable sortable body' ) ) . "\n";
+               $out = '';
+               $out .= Html::openElement(
+                       'table',
+                       array( 'class' => 'mw-interwikitable wikitable sortable 
body' )
+               ) . "\n";
                $out .= Html::openElement( 'tr', array( 'id' => 
'interwikitable-header' ) ) .
                        Html::element( 'th', null, $this->msg( 
'interwiki_prefix' )->text() ) .
                        Html::element( 'th', null, $this->msg( 'interwiki_url' 
)->text() ) .
                        Html::element( 'th', null, $this->msg( 
'interwiki_local' )->text() ) .
                        Html::element( 'th', null, $this->msg( 
'interwiki_trans' )->text() ) .
-                       ( $canModify ? Html::element( 'th', array( 'class' => 
'unsortable' ), $this->msg( 'interwiki_edit' )->text() ) : '' );
+                       ( $canModify ?
+                               Html::element(
+                                       'th',
+                                       array( 'class' => 'unsortable' ),
+                                       $this->msg( 'interwiki_edit' )->text()
+                               ) :
+                               ''
+                       );
                $out .= Html::closeElement( 'tr' ) . "\n";
 
                $selfTitle = $this->getTitle();
@@ -332,23 +370,31 @@
                        $out .= Html::openElement( 'tr', array( 'class' => 
'mw-interwikitable-row' ) );
                        $out .= Html::element( 'td', array( 'class' => 
'mw-interwikitable-prefix' ),
                                $iwPrefix['iw_prefix'] );
-                       $out .= Html::element( 'td', array( 'class' => 
'mw-interwikitable-url' ), $iwPrefix['iw_url'] );
+                       $out .= Html::element(
+                               'td',
+                               array( 'class' => 'mw-interwikitable-url' ),
+                               $iwPrefix['iw_url']
+                       );
                        $attribs = array( 'class' => 'mw-interwikitable-local' 
);
                        // Green background for cells with "yes".
                        if( $iwPrefix['iw_local'] ) {
                                $attribs['style'] = 'background: lime;';
                        }
                        // The messages interwiki_0 and interwiki_1 are used 
here.
-                       $out .= Html::element( 'td', $attribs,
-                               ( isset( $iwPrefix['iw_local'] ) ? $this->msg( 
'interwiki_' . $iwPrefix['iw_local'] )->text() : '-' ) );
+                       $contents = isset( $iwPrefix['iw_local'] ) ?
+                               $this->msg( 'interwiki_' . 
$iwPrefix['iw_local'] )->text() :
+                               '-';
+                       $out .= Html::element( 'td', $attribs, $contents );
                        $attribs = array( 'class' => 'mw-interwikitable-trans' 
);
                        // Green background for cells with "yes".
                        if( $iwPrefix['iw_trans'] ) {
                                $attribs['style'] = 'background: lime;';
                        }
                        // The messages interwiki_0 and interwiki_1 are used 
here.
-                       $out .= Html::element( 'td', $attribs,
-                               ( isset( $iwPrefix['iw_trans'] ) ? $this->msg( 
'interwiki_' . $iwPrefix['iw_trans'] )->text() : '-' ) );
+                       $contents = isset( $iwPrefix['iw_trans'] ) ?
+                               $this->msg( 'interwiki_' . 
$iwPrefix['iw_trans'] )->text() :
+                               '-';
+                       $out .= Html::element( 'td', $attribs, $contents );
 
                        // Additional column when the interwiki table can be 
modified.
                        if ( $canModify ) {
@@ -377,7 +423,11 @@
        private function addInfoRow( $align = 'start', $title, $text ) {
                return Html::rawElement( 'tr', null,
                        // The classes mw-align-start and mw-align-end are used 
here.
-                       Html::rawElement( 'th', array( 'class' => 'mw-align-' . 
$align ), $this->msg( $title )->escaped() ) .
+                       Html::rawElement(
+                               'th',
+                               array( 'class' => 'mw-align-' . $align ),
+                               $this->msg( $title )->escaped()
+                       ) .
                        // This message is expected to have wiki syntax
                        Html::rawElement( 'td', null, $this->msg( $text 
)->parse() )
                );

-- 
To view, visit https://gerrit.wikimedia.org/r/77322
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I442b4e55521089ab64b049c8087985af202515dd
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Interwiki
Gerrit-Branch: master
Gerrit-Owner: Siebrand <[email protected]>
Gerrit-Reviewer: Nikerabbit <[email protected]>
Gerrit-Reviewer: Platonides <[email protected]>
Gerrit-Reviewer: Reedy <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to