Fix phpcs errors and warnings in includes/specials
authorKunal Mehta <legoktm@gmail.com>
Sun, 15 Mar 2015 02:50:37 +0000 (19:50 -0700)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 16 Mar 2015 18:29:40 +0000 (18:29 +0000)
Change-Id: I7608459fd50963fa8478b97ccd8f5a1a9d87aae8

includes/specials/SpecialAllPages.php
includes/specials/SpecialChangeEmail.php
includes/specials/SpecialJavaScriptTest.php
includes/specials/SpecialLog.php
includes/specials/SpecialPrefixindex.php
includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRunJobs.php
includes/specials/SpecialVersion.php
includes/specials/SpecialWhatlinkshere.php

index 08b8761..74b1f7b 100644 (file)
@@ -101,7 +101,10 @@ class SpecialAllPages extends IncludableSpecialPage {
                $t = $this->getPageTitle();
 
                $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
-               $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) ) );
+               $out .= Xml::openElement(
+                       'form',
+                       array( 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) )
+               );
                $out .= Html::hidden( 'title', $t->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, $this->msg( 'allpages' )->text() );
index 674cbc8..eca307d 100644 (file)
@@ -141,7 +141,8 @@ class SpecialChangeEmail extends FormSpecialPage {
                        # Notify user that a confirmation email has been sent...
                        $this->getOutput()->wrapWikiMsg( "<div class='error' style='clear: both;'>\n$1\n</div>",
                                'eauthentsent', $this->getUser()->getName() );
-                       $this->getOutput()->addReturnTo( $titleObj, wfCgiToArray( $query ) ); // just show the link to go back
+                       // just show the link to go back
+                       $this->getOutput()->addReturnTo( $titleObj, wfCgiToArray( $query ) );
                }
        }
 
index 492105d..ecb166a 100644 (file)
@@ -242,9 +242,13 @@ HTML;
                        'debug' => ResourceLoader::inDebugMode() ? 'true' : 'false',
                ) );
 
-               $styles = $out->makeResourceLoaderLink( 'jquery.qunit', ResourceLoaderModule::TYPE_STYLES, false );
+               $styles = $out->makeResourceLoaderLink(
+                       'jquery.qunit', ResourceLoaderModule::TYPE_STYLES, false
+               );
                // Use 'raw' since this is a plain HTML page without ResourceLoader
-               $scripts = $out->makeResourceLoaderLink( 'jquery.qunit', ResourceLoaderModule::TYPE_SCRIPTS, false, array( 'raw' => 'true' ) );
+               $scripts = $out->makeResourceLoaderLink(
+                       'jquery.qunit', ResourceLoaderModule::TYPE_SCRIPTS, false, array( 'raw' => 'true' )
+               );
 
                $head = trim( $styles['html'] . $scripts['html'] );
                $html = <<<HTML
index 9315eb8..44a2c34 100644 (file)
@@ -97,7 +97,10 @@ class SpecialLog extends SpecialPage {
                        }
                } else {
                        // Allow extensions to add relations to their search types
-                       Hooks::run( 'SpecialLogAddLogSearchRelations', array( $opts->getValue( 'type' ), $this->getRequest(), &$qc ) );
+                       Hooks::run(
+                               'SpecialLogAddLogSearchRelations',
+                               array( $opts->getValue( 'type' ), $this->getRequest(), &$qc )
+                       );
                }
 
                # Some log types are only for a 'User:' title but we might have been given
index 2e67e2b..5a67d92 100644 (file)
@@ -102,7 +102,10 @@ class SpecialPrefixindex extends SpecialAllPages {
         */
        protected function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) {
                $out = Xml::openElement( 'div', array( 'class' => 'namespaceoptions' ) );
-               $out .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) ) );
+               $out .= Xml::openElement(
+                       'form',
+                       array( 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) )
+               );
                $out .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() );
                $out .= Xml::openElement( 'fieldset' );
                $out .= Xml::element( 'legend', null, $this->msg( 'allpages' )->text() );
index efb870b..64b0eca 100644 (file)
@@ -252,7 +252,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                return $rows;
        }
 
-       protected function runMainQueryHook( &$tables, &$fields, &$conds, &$query_options, &$join_conds, $opts ) {
+       protected function runMainQueryHook( &$tables, &$fields, &$conds,
+               &$query_options, &$join_conds, $opts
+       ) {
                return parent::runMainQueryHook( $tables, $fields, $conds, $query_options, $join_conds, $opts )
                        && Hooks::run(
                                'SpecialRecentChangesQuery',
@@ -311,7 +313,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                        $rc = RecentChange::newFromRow( $obj );
                        $rc->counter = $counter++;
                        # Check if the page has been updated since the last visit
-                       if ( $this->getConfig()->get( 'ShowUpdatedMarker' ) && !empty( $obj->wl_notificationtimestamp ) ) {
+                       if ( $this->getConfig()->get( 'ShowUpdatedMarker' )
+                               && !empty( $obj->wl_notificationtimestamp )
+                       ) {
                                $rc->notificationtimestamp = ( $obj->rc_timestamp >= $obj->wl_notificationtimestamp );
                        } else {
                                $rc->notificationtimestamp = false; // Default
@@ -732,7 +736,8 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
 
                        $link = $this->makeOptionsLink( $linkMessage->text(),
                                array( $key => 1 - $options[$key] ), $nondefaults );
-                       $links[] = "<span class=\"$msg rcshowhideoption\">" . $this->msg( $msg )->rawParams( $link )->escaped() . '</span>';
+                       $links[] = "<span class=\"$msg rcshowhideoption\">"
+                               . $this->msg( $msg )->rawParams( $link )->escaped() . '</span>';
                }
 
                // show from this onward link
index 1bafc61..0d44d34 100644 (file)
@@ -61,10 +61,11 @@ class SpecialRunJobs extends UnlistedSpecialPage {
 
                $squery = $params;
                unset( $squery['signature'] );
-               $cSig = self::getQuerySignature( $squery, $this->getConfig()->get( 'SecretKey' ) ); // correct signature
-               $rSig = $params['signature']; // provided signature
+               $correctSignature = self::getQuerySignature( $squery, $this->getConfig()->get( 'SecretKey' ) );
+               $providedSignature = $params['signature'];
 
-               $verified = is_string( $rSig ) && hash_equals( $cSig, $rSig );
+               $verified = is_string( $providedSignature )
+                       && hash_equals( $correctSignature, $providedSignature );
                if ( !$verified || $params['sigexpiry'] < time() ) {
                        header( "HTTP/1.0 400 Bad Request" );
                        print 'Invalid or stale signature provided';
index a7365bb..c1a9593 100644 (file)
@@ -515,7 +515,10 @@ class SpecialVersion extends SpecialPage {
                        array( 'id' => 'mw-version-libraries' ),
                        $this->msg( 'version-libraries' )->text()
                );
-               $out .= Html::openElement( 'table', array( 'class' => 'wikitable plainlinks', 'id' => 'sv-libraries' ) );
+               $out .= Html::openElement(
+                       'table',
+                       array( 'class' => 'wikitable plainlinks', 'id' => 'sv-libraries' )
+               );
                $out .= Html::openElement( 'tr' )
                        . Html::element( 'th', array(), $this->msg( 'version-libraries-library' )->text() )
                        . Html::element( 'th', array(), $this->msg( 'version-libraries-version' )->text() )
@@ -528,7 +531,11 @@ class SpecialVersion extends SpecialPage {
                                continue;
                        }
                        $out .= Html::openElement( 'tr' )
-                               . Html::rawElement( 'td', array(), Linker::makeExternalLink( "https://packagist.org/packages/$name", $name ) )
+                               . Html::rawElement(
+                                       'td',
+                                       array(),
+                                       Linker::makeExternalLink( "https://packagist.org/packages/$name", $name )
+                               )
                                . Html::element( 'td', array(), $info['version'] )
                                . Html::closeElement( 'tr' );
                }
@@ -588,11 +595,15 @@ class SpecialVersion extends SpecialPage {
 
                $fhooks = $wgParser->getFunctionHooks();
                if ( count( $fhooks ) ) {
-                       $out = Html::rawElement( 'h2', array( 'class' => 'mw-headline plainlinks' ), Linker::makeExternalLink(
-                               '//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions',
-                               $this->msg( 'version-parser-function-hooks' )->parse(),
-                               false /* msg()->parse() already escapes */
-                       ) );
+                       $out = Html::rawElement(
+                               'h2',
+                               array( 'class' => 'mw-headline plainlinks' ),
+                               Linker::makeExternalLink(
+                                       '//www.mediawiki.org/wiki/Special:MyLanguage/Manual:Parser_functions',
+                                       $this->msg( 'version-parser-function-hooks' )->parse(),
+                                       false /* msg()->parse() already escapes */
+                               )
+                       );
 
                        $out .= $this->listToText( $fhooks );
                } else {
index 28be790..40cce5e 100644 (file)
@@ -152,7 +152,9 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
                        $conds['pagelinks'][] = 'rd_from is NOT NULL';
                }
 
-               $queryFunc = function ( $dbr, $table, $fromCol ) use ( $conds, $target, $limit, $useLinkNamespaceDBFields ) {
+               $queryFunc = function ( $dbr, $table, $fromCol ) use (
+                       $conds, $target, $limit, $useLinkNamespaceDBFields
+               ) {
                        // Read an extra row as an at-end check
                        $queryLimit = $limit + 1;
                        $on = array(
@@ -278,7 +280,11 @@ class SpecialWhatLinksHere extends IncludableSpecialPage {
 
                        if ( $row->rd_from && $level < 2 ) {
                                $out->addHTML( $this->listItem( $row, $nt, $target, true ) );
-                               $this->showIndirectLinks( $level + 1, $nt, $this->getConfig()->get( 'MaxRedirectLinksRetrieved' ) );
+                               $this->showIndirectLinks(
+                                       $level + 1,
+                                       $nt,
+                                       $this->getConfig()->get( 'MaxRedirectLinksRetrieved' )
+                               );
                                $out->addHTML( Xml::closeElement( 'li' ) );
                        } else {
                                $out->addHTML( $this->listItem( $row, $nt, $target ) );