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

Change subject: phpcs fixes throughout
......................................................................


phpcs fixes throughout

Change-Id: I761c7c8a2832651995a0abcf5bf991a62bc55c25
---
M Collection.body.php
M Collection.hooks.php
M Collection.php
M Collection.suggest.php
M RenderingAPI.php
5 files changed, 88 insertions(+), 35 deletions(-)

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



diff --git a/Collection.body.php b/Collection.body.php
index c61fd7b..c41b0f2 100644
--- a/Collection.body.php
+++ b/Collection.body.php
@@ -444,7 +444,7 @@
                $result = array();
 
                $t = wfMessage( 'coll-user_book_prefix', $wgUser->getName() 
)->inContentLanguage();
-               if ( $t->isDisabled()  ) {
+               if ( $t->isDisabled() ) {
                        $userPageTitle = 
$wgUser->getUserPage()->getPrefixedText();
                        $result['user-prefix'] = $userPageTitle . '/'
                                . wfMessage( 'coll-collections' 
)->inContentLanguage()->text() . '/';
@@ -788,7 +788,10 @@
                        $collection['subtitle'] = $match[ 1 ];
                } elseif ( !$append && preg_match( '/^==\s*(.*?)\s*==$/', 
$line, $match ) ) {
                        $collection['title'] = $match[ 1 ];
-               } elseif ( !$append && preg_match( 
'/^\s*\|\s*setting-([a-zA-Z0-9_-]+)\s*=\s*([^|]*)\s*$/', $line, $match ) ) {
+               } elseif (
+                       !$append &&
+                       preg_match( 
'/^\s*\|\s*setting-([a-zA-Z0-9_-]+)\s*=\s*([^|]*)\s*$/', $line, $match )
+               ) {
                        $collection['settings'][$match[ 1 ]] = $match[ 2 ];
                } elseif ( substr( $line, 0, 1 ) == ';' ) { // chapter
                        return array(
@@ -806,7 +809,9 @@
                                }
                                $oldid = - 1;
                                $currentVersion = 1;
-                       } elseif ( preg_match( 
'/^\[\{\{fullurl:(.*?)\|oldid=(.*?)\}\}\s+(.*?)\]$/', $articleTitle, $match ) ) 
{
+                       } elseif (
+                               preg_match( 
'/^\[\{\{fullurl:(.*?)\|oldid=(.*?)\}\}\s+(.*?)\]$/', $articleTitle, $match )
+                       ) {
                                $articleTitle = $match[1];
                                if ( isset( $match[3] ) ) {
                                        $displayTitle = $match[3];
@@ -957,7 +962,8 @@
                if ( !$t->isDisabled() ) {
                        $catTitle = Title::makeTitle( NS_CATEGORY, $t->text() );
                        if ( !is_null( $catTitle ) ) {
-                               $articleText .= "\n[[" . 
$catTitle->getPrefixedText() . "|" . wfEscapeWikiText( $title->getSubpageText() 
) . "]]\n";
+                               $articleText .= "\n[[" . 
$catTitle->getPrefixedText() .
+                                       "|" . wfEscapeWikiText( 
$title->getSubpageText() ) . "]]\n";
                        }
                }
 
@@ -968,7 +974,9 @@
                                'title' => $title->getPrefixedText(),
                                'text' => $articleText,
                                'token' => $this->getUser()->getEditToken(),
-               ), true);
+                       ),
+                       true
+               );
                $api = new ApiMain( $req, true );
                $api->execute();
                return true;
@@ -1051,7 +1059,10 @@
                switch ( $result->get( 'state' ) ) {
                case 'pending':
                case 'progress':
-                       $out->addHeadItem( 'refresh-nojs', '<noscript><meta 
http-equiv="refresh" content="2" /></noscript>' );
+                       $out->addHeadItem(
+                               'refresh-nojs',
+                               '<noscript><meta http-equiv="refresh" 
content="2" /></noscript>'
+                       );
                        $out->addInlineScript( 'var collection_id = "' . 
urlencode( $collectionId ) . '";' );
                        $out->addInlineScript( 'var writer = "' . urlencode( 
$writer ) . '";' );
                        $out->addInlineScript( 'var collection_rendering = 
true;' );
@@ -1061,10 +1072,14 @@
                        $statusText = $result->get( 'status', 'status' );
                        if ( $statusText ) {
                                if ( $result->get( 'status', 'article' ) ) {
-                                       $statusText .= ' ' . $this->msg( 
'coll-rendering_article', $result->get( 'status', 'article' ) )->text();
+                                       $statusText .= ' ' . $this->msg(
+                                                       
'coll-rendering_article',
+                                                       $result->get( 'status', 
'article' )
+                                               )->text();
                                } elseif ( $result->get( 'status', 'page' ) ) {
                                        $statusText .= ' ';
-                                       $statusText .= $this->msg( 
'coll-rendering_page' )->numParams( $result->get( 'status', 'page' ) )->text();
+                                       $statusText .= $this->msg( 
'coll-rendering_page' )
+                                               ->numParams( $result->get( 
'status', 'page' ) )->text();
                                }
                                $status = $this->msg( 'coll-rendering_status', 
$statusText )->text();
                        } else {
@@ -1085,7 +1100,13 @@
                        $out->setPageTitle( $this->msg( 
'coll-rendering_finished_title' ) );
 
                        $template = new CollectionFinishedTemplate();
-                       $template->set( 'download_url', wfExpandUrl( 
SkinTemplate::makeSpecialUrl( 'Book', 'bookcmd=download&' . $query ), 
PROTO_CURRENT ) );
+                       $template->set(
+                               'download_url',
+                               wfExpandUrl(
+                                       SkinTemplate::makeSpecialUrl( 'Book', 
'bookcmd=download&' . $query ),
+                                       PROTO_CURRENT
+                               )
+                       );
                        $template->set( 'is_cached', $request->getVal( 
'is_cached' ) );
                        $template->set( 'writer', $request->getVal( 'writer' ) 
);
                        $template->set( 'query', $query );
@@ -1112,7 +1133,7 @@
                        break;
                default:
                        $stats->increment( 'collection.renderingpage.unknown' );
-                       throw new Exception( __METHOD__ . "(): unknown state 
'{$result->get( 'state' )}'");
+                       throw new Exception( __METHOD__ . "(): unknown state 
'{$result->get( 'state' )}'" );
                }
        }
 
@@ -1148,7 +1169,10 @@
                        }
                }
                if ( !$info ) {
-                       $this->getOutput()->showErrorPage( 
'coll-download_notfound_title', 'coll-download_notfound_text' );
+                       $this->getOutput()->showErrorPage(
+                               'coll-download_notfound_title',
+                               'coll-download_notfound_text'
+                       );
                        return;
                }
                wfResetOutputBuffers();
@@ -1160,7 +1184,11 @@
                        $ct_enc = explode( ';', $content_type );
                        $ct = $ct_enc[0];
                        if ( isset( $wgCollectionContentTypeToFilename[$ct] ) ) 
{
-                               header( 'Content-Disposition: ' . 'inline; 
filename=' . $wgCollectionContentTypeToFilename[$ct] );
+                               header(
+                                       'Content-Disposition: ' .
+                                       'inline; filename=' .
+                                       $wgCollectionContentTypeToFilename[$ct]
+                               );
                        }
                }
                fseek( $this->tempfile, 0 );
@@ -1218,7 +1246,7 @@
                        $collection['settings'] = array();
                }
                foreach ( $wgCollectionRendererSettings as $key => $desc ) {
-                       if ( $desc['type'] != 'select') {
+                       if ( $desc['type'] != 'select' ) {
                                continue;
                        }
                        $val = $request->getVal( $key );
diff --git a/Collection.hooks.php b/Collection.hooks.php
index 39902ab..756390e 100644
--- a/Collection.hooks.php
+++ b/Collection.hooks.php
@@ -95,19 +95,28 @@
                        return false;
                }
 
-               $out = Array();
+               $out = array();
 
                $booktitle = SpecialPage::getTitleFor( 'Book' );
                if ( !CollectionSession::isEnabled() ) {
-                       $out[] = Array( 'text' => $sk->msg( 
'coll-create_a_book' )->escaped(),
-                                       'id' => 'coll-create_a_book',
-                                       'href' => $booktitle->getLocalURL( 
array( 'bookcmd' => 'book_creator', 'referer' => $title->getPrefixedText() ) )
-                              );
+                       $out[] = array(
+                               'text' => $sk->msg( 'coll-create_a_book' 
)->escaped(),
+                               'id' => 'coll-create_a_book',
+                               'href' => $booktitle->getLocalURL(
+                                       array( 'bookcmd' => 'book_creator', 
'referer' => $title->getPrefixedText() )
+                               ),
+                       );
                } else {
-                       $out[] = Array( 'text' => $sk->msg( 
'coll-book_creator_disable' )->escaped(),
-                                       'id' => 'coll-book_creator_disable',
-                                       'href' => $booktitle->getLocalURL( 
array( 'bookcmd' => 'stop_book_creator', 'referer' => $title->getPrefixedText() 
) )
-                                );
+                       $out[] = array(
+                               'text' => $sk->msg( 'coll-book_creator_disable' 
)->escaped(),
+                               'id' => 'coll-book_creator_disable',
+                               'href' => $booktitle->getLocalURL(
+                                       array(
+                                               'bookcmd' => 
'stop_book_creator',
+                                               'referer' => 
$title->getPrefixedText(),
+                                       )
+                               ),
+                       );
                }
 
                $params = array(
@@ -125,16 +134,17 @@
 
                foreach ( $wgCollectionPortletFormats as $writer ) {
                        $params['writer'] = $writer;
-                       $out[] = Array( 'text' => $sk->msg( 'coll-download_as', 
$wgCollectionFormats[$writer] )->escaped(),
-                                       'id' => 'coll-download-as-' . $writer,
-                                       'href' => $booktitle->getLocalURL( 
$params )
-                                );
+                       $out[] = array(
+                               'text' => $sk->msg( 'coll-download_as', 
$wgCollectionFormats[$writer] )->escaped(),
+                               'id' => 'coll-download-as-' . $writer,
+                               'href' => $booktitle->getLocalURL( $params ),
+                       );
                }
 
                // Move the 'printable' link into our section for consistency
                if ( $action == 'view' || $action == 'purge' ) {
                        if ( !$sk->getOutput()->isPrintable() ) {
-                               $out[] = Array( 'text' => $sk->msg( 
'printableversion' )->text(),
+                               $out[] = array( 'text' => $sk->msg( 
'printableversion' )->text(),
                                                'id' => 't-print',
                                                'href' => $title->getLocalURL( 
array( 'printable' => 'yes' ) )
                                        );
diff --git a/Collection.php b/Collection.php
index 1002400..4b914e4 100644
--- a/Collection.php
+++ b/Collection.php
@@ -34,7 +34,7 @@
        'path' => __FILE__,
        'name' => 'Collection',
        'version' => '1.7.0',
-       'author' => array( 'PediaPress GmbH', 'Siebrand Mazeland', 'Marcin 
Cieślak'),
+       'author' => array( 'PediaPress GmbH', 'Siebrand Mazeland', 'Marcin 
Cieślak' ),
        'url' => 'https://www.mediawiki.org/wiki/Extension:Collection',
        'descriptionmsg' => 'coll-desc',
        'license-name' => 'GPL-2.0+',
@@ -284,7 +284,8 @@
 $wgAjaxExportList[] = 'wfAjaxPostCollection';
 
 function wfAjaxGetMWServeStatus( $collection_id = '', $writer = 'rl' ) {
-       $response = CollectionRenderingAPI::instance( $writer 
)->getRenderStatus( $collection_id );
+       $response = CollectionRenderingAPI::instance( $writer )
+               ->getRenderStatus( $collection_id );
        $result = $response->response;
        if ( isset( $result['status']['progress'] ) ) {
                $result['status']['progress'] = number_format( 
$result['status']['progress'], 2, '.', '' );
@@ -317,7 +318,11 @@
 
 $wgAjaxExportList[] = 'wfAjaxCollectionAddCategory';
 
-function wfAjaxCollectionGetBookCreatorBoxContent( $ajaxHint = '', $oldid = 
null, $pageName = null ) {
+function wfAjaxCollectionGetBookCreatorBoxContent(
+       $ajaxHint = '',
+       $oldid = null,
+       $pageName = null
+) {
        if ( !is_null( $oldid ) ) {
                $oldid = intval( $oldid );
        }
@@ -468,7 +473,10 @@
                ),
                wfMessage( 'coll-suggest_undo' )->text()
        );
-       // Message keys used: coll-suggest_article_ban, 
coll-suggest_article_add, coll-suggest_article_remove
+       // Message keys used:
+       // coll-suggest_article_ban
+       // coll-suggest_article_add
+       // coll-suggest_article_remove
        $result['last_action'] = wfMessage( "coll-suggest_article_$action", 
$article )
                ->rawParams( $undoLink )->parse();
        $result['collection'] = CollectionSession::getCollection();
diff --git a/Collection.suggest.php b/Collection.suggest.php
index b8dea6c..b264aef 100644
--- a/Collection.suggest.php
+++ b/Collection.suggest.php
@@ -82,7 +82,9 @@
                return array(
                        'suggestions_html' => $template->getProposalList(),
                        'members_html' => $template->getMemberList(),
-                       'num_pages' => wfMessage( 'coll-n_pages' )->numParams( 
CollectionSession::countArticles() )->escaped()
+                       'num_pages' => wfMessage( 'coll-n_pages' )
+                               ->numParams( CollectionSession::countArticles() 
)
+                               ->escaped(),
                );
        }
 
@@ -168,7 +170,7 @@
                        $_SESSION['wsCollectionSuggestProp'] = array();
                }
 
-               switch( $mode ) {
+               switch ( $mode ) {
                        case 'add':
                                SpecialCollection::addArticleFromName( NS_MAIN, 
$param );
                                self::unban( $param );
diff --git a/RenderingAPI.php b/RenderingAPI.php
index 2fee498..fc427ac 100644
--- a/RenderingAPI.php
+++ b/RenderingAPI.php
@@ -280,7 +280,8 @@
  */
 class MWServeRenderingAPI extends CollectionRenderingAPI {
        protected function makeRequest( $command, array $params ) {
-               global $wgCollectionMWServeURL, 
$wgCollectionMWServeCredentials, $wgCollectionFormatToServeURL, 
$wgCollectionCommandToServeURL;
+               global $wgCollectionMWServeURL, $wgCollectionMWServeCredentials,
+                       $wgCollectionFormatToServeURL, 
$wgCollectionCommandToServeURL;
 
                $serveURL = $wgCollectionMWServeURL;
                if ( $this->writer ) {
@@ -300,7 +301,11 @@
                // If $serveURL has a | in it, we need to use a proxy.
                list( $proxy, $serveURL ) = array_pad( explode( '|', $serveURL, 
2 ), -2, '' );
 
-               $response = Http::post( $serveURL, array( 'postData' => 
$params, 'proxy' => $proxy ), __METHOD__ );
+               $response = Http::post(
+                       $serveURL,
+                       array( 'postData' => $params, 'proxy' => $proxy ),
+                       __METHOD__
+               );
                if ( $response === false ) {
                        wfDebugLog( 'collection', "Request to $serveURL 
resulted in error" );
                }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I761c7c8a2832651995a0abcf5bf991a62bc55c25
Gerrit-PatchSet: 4
Gerrit-Project: mediawiki/extensions/Collection
Gerrit-Branch: master
Gerrit-Owner: Addshore <addshorew...@gmail.com>
Gerrit-Reviewer: Aude <aude.w...@gmail.com>
Gerrit-Reviewer: C. Scott Ananian <canan...@wikimedia.org>
Gerrit-Reviewer: Legoktm <legoktm.wikipe...@gmail.com>
Gerrit-Reviewer: Thiemo Mättig (WMDE) <thiemo.maet...@wikimedia.de>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to