From 7a635c5dfda079f84370ca8d19fd6ab9fcfc7870 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Sun, 23 Mar 2014 02:28:57 +0100 Subject: [PATCH] Try to make a dent in CodeSniffer reports on includes/ (1) Change-Id: Iaf3120b4e32cc5835ef9ed86236d98679e2b87fa --- includes/AjaxResponse.php | 16 ++-- includes/Article.php | 153 ++++++++++++++++++++++++++--------- includes/Autopromote.php | 3 +- includes/Block.php | 11 ++- includes/CacheHelper.php | 13 +-- includes/Category.php | 20 +++-- includes/CategoryViewer.php | 18 ++++- includes/ChangeTags.php | 86 +++++++++++++++----- includes/DefaultSettings.php | 7 +- includes/Export.php | 19 +++-- 10 files changed, 248 insertions(+), 98 deletions(-) diff --git a/includes/AjaxResponse.php b/includes/AjaxResponse.php index 334cee3772..4b5ca75eb0 100644 --- a/includes/AjaxResponse.php +++ b/includes/AjaxResponse.php @@ -28,7 +28,6 @@ * @ingroup Ajax */ class AjaxResponse { - /** * Number of seconds to get the response cached by a proxy * @var int $mCacheDuration @@ -184,10 +183,10 @@ class AjaxResponse { } } else { - # Let the client do the caching. Cache is not purged. header ( "Expires: " . gmdate( "D, d M Y H:i:s", time() + $this->mCacheDuration ) . " GMT" ); - header ( "Cache-Control: s-maxage={$this->mCacheDuration},public,max-age={$this->mCacheDuration}" ); + header ( "Cache-Control: s-maxage={$this->mCacheDuration}," . + "public,max-age={$this->mCacheDuration}" ); } } else { @@ -237,17 +236,22 @@ class AjaxResponse { wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", 'log' ); wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", 'log' ); - if ( ( $ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) { + if ( ( $ismodsince >= $timestamp ) + && $wgUser->validateCache( $ismodsince ) && + $ismodsince >= $wgCacheEpoch + ) { ini_set( 'zlib.output_compression', 0 ); $this->setResponseCode( "304 Not Modified" ); $this->disable(); $this->mLastModified = $lastmod; - wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); + wfDebug( "$fname: CACHED client: $ismodsince ; user: {$wgUser->getTouched()} ; " . + "page: $timestamp ; site $wgCacheEpoch\n", 'log' ); return true; } else { - wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; page: $timestamp ; site $wgCacheEpoch\n", 'log' ); + wfDebug( "$fname: READY client: $ismodsince ; user: {$wgUser->getTouched()} ; " . + "page: $timestamp ; site $wgCacheEpoch\n", 'log' ); $this->mLastModified = $lastmod; } } else { diff --git a/includes/Article.php b/includes/Article.php index b132ca9f9a..d45b3322bd 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -367,9 +367,11 @@ class Article implements Page { * Does *NOT* follow redirects. * * @protected - * @note this is really internal functionality that should really NOT be used by other functions. For accessing - * article content, use the WikiPage class, especially WikiBase::getContent(). However, a lot of legacy code - * uses this method to retrieve page text from the database, so the function has to remain public for now. + * @note This is really internal functionality that should really NOT be + * used by other functions. For accessing article content, use the WikiPage + * class, especially WikiBase::getContent(). However, a lot of legacy code + * uses this method to retrieve page text from the database, so the function + * has to remain public for now. * * @return mixed string containing article contents, or false if null * @deprecated in 1.21, use WikiPage::getContent() instead @@ -397,9 +399,10 @@ class Article implements Page { /** * Get text content object * Does *NOT* follow redirects. - * TODO: when is this null? + * @todo When is this null? * - * @note code that wants to retrieve page content from the database should use WikiPage::getContent(). + * @note Code that wants to retrieve page content from the database should + * use WikiPage::getContent(). * * @return Content|null|boolean false * @@ -434,7 +437,8 @@ class Article implements Page { } } else { if ( !$this->mPage->getLatest() ) { - wfDebug( __METHOD__ . " failed to find page data for title " . $this->getTitle()->getPrefixedText() . "\n" ); + wfDebug( __METHOD__ . " failed to find page data for title " . + $this->getTitle()->getPrefixedText() . "\n" ); wfProfileOut( __METHOD__ ); return false; } @@ -442,7 +446,8 @@ class Article implements Page { $this->mRevision = $this->mPage->getRevision(); if ( !$this->mRevision ) { - wfDebug( __METHOD__ . " failed to retrieve current page, rev_id " . $this->mPage->getLatest() . "\n" ); + wfDebug( __METHOD__ . " failed to retrieve current page, rev_id " . + $this->mPage->getLatest() . "\n" ); wfProfileOut( __METHOD__ ); return false; } @@ -450,7 +455,11 @@ class Article implements Page { // @todo FIXME: Horrible, horrible! This content-loading interface just plain sucks. // We should instead work with the Revision object when we need it... - $this->mContentObject = $this->mRevision->getContent( Revision::FOR_THIS_USER, $this->getContext()->getUser() ); // Loads if user is allowed + // Loads if user is allowed + $this->mContentObject = $this->mRevision->getContent( + Revision::FOR_THIS_USER, + $this->getContext()->getUser() + ); $this->mRevIdFetched = $this->mRevision->getId(); wfRunHooks( 'ArticleAfterFetchContentObject', array( &$this, &$this->mContentObject ) ); @@ -711,7 +720,8 @@ class Article implements Page { # Don't cache a dirty ParserOutput object if ( $poolArticleView->getIsDirty() ) { $outputPage->setSquidMaxage( 0 ); - $outputPage->addHTML( "\n" ); + $outputPage->addHTML( "\n" ); } $outputDone = true; @@ -794,13 +804,21 @@ class Article implements Page { } $contentHandler = $rev->getContentHandler(); - $de = $contentHandler->createDifferenceEngine( $this->getContext(), $oldid, $diff, $rcid, $purge, $unhide ); + $de = $contentHandler->createDifferenceEngine( + $this->getContext(), + $oldid, + $diff, + $rcid, + $purge, + $unhide + ); // DifferenceEngine directly fetched the revision: $this->mRevIdFetched = $de->mNewid; $de->showDiffPage( $diffOnly ); - // Run view updates for the newer revision being diffed (and shown below the diff if not $diffOnly) + // Run view updates for the newer revision being diffed (and shown + // below the diff if not $diffOnly). list( $old, $new ) = $de->mapDiffPrevNext( $oldid, $diff ); // New can be false, convert it to 0 - this conveniently means the latest revision $this->mPage->doViewUpdates( $user, (int)$new ); @@ -813,7 +831,8 @@ class Article implements Page { * This is hooked by SyntaxHighlight_GeSHi to do syntax highlighting of these * page views. * - * @param bool $showCacheHint whether to show a message telling the user to clear the browser cache (default: true). + * @param bool $showCacheHint whether to show a message telling the user + * to clear the browser cache (default: true). */ protected function showCssOrJsPage( $showCacheHint = true ) { $outputPage = $this->getContext()->getOutput(); @@ -822,15 +841,20 @@ class Article implements Page { $dir = $this->getContext()->getLanguage()->getDir(); $lang = $this->getContext()->getLanguage()->getCode(); - $outputPage->wrapWikiMsg( "
\n$1\n
", - 'clearyourcache' ); + $outputPage->wrapWikiMsg( + "
\n$1\n
", + 'clearyourcache' + ); } $this->fetchContentObject(); if ( $this->mContentObject ) { // Give hooks a chance to customise the output - if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mContentObject, $this->getTitle(), $outputPage ) ) ) { + if ( ContentHandler::runLegacyHooks( + 'ShowRawCssJs', + array( $this->mContentObject, $this->getTitle(), $outputPage ) ) + ) { $po = $this->mContentObject->getParserOutput( $this->getTitle() ); $outputPage->addHTML( $po->getText() ); } @@ -1007,7 +1031,10 @@ class Article implements Page { public function showNamespaceHeader() { if ( $this->getTitle()->isTalkPage() ) { if ( !wfMessage( 'talkpageheader' )->isDisabled() ) { - $this->getContext()->getOutput()->wrapWikiMsg( "
\n$1\n
", array( 'talkpageheader' ) ); + $this->getContext()->getOutput()->wrapWikiMsg( + "
\n$1\n
", + array( 'talkpageheader' ) + ); } } } @@ -1017,7 +1044,9 @@ class Article implements Page { */ public function showViewFooter() { # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page - if ( $this->getTitle()->getNamespace() == NS_USER_TALK && IP::isValid( $this->getTitle()->getText() ) ) { + if ( $this->getTitle()->getNamespace() == NS_USER_TALK + && IP::isValid( $this->getTitle()->getText() ) + ) { $this->getContext()->getOutput()->addWikiMsg( 'anontalkpagetext' ); } @@ -1025,7 +1054,6 @@ class Article implements Page { $patrolFooterShown = $this->showPatrolFooter(); wfRunHooks( 'ArticleViewFooter', array( $this, $patrolFooterShown ) ); - } /** @@ -1045,7 +1073,9 @@ class Article implements Page { $cache = wfGetMainCache(); $rc = false; - if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) || !( $wgUseRCPatrol || $wgUseNPPatrol ) ) { + if ( !$this->getTitle()->quickUserCan( 'patrol', $user ) + || !( $wgUseRCPatrol || $wgUseNPPatrol ) + ) { // Patrolling is disabled or the user isn't allowed to return false; } @@ -1064,7 +1094,9 @@ class Article implements Page { return false; } - if ( $this->mRevision && !RecentChange::isInRCLifespan( $this->mRevision->getTimestamp(), 21600 ) ) { + if ( $this->mRevision + && !RecentChange::isInRCLifespan( $this->mRevision->getTimestamp(), 21600 ) + ) { // The current revision is already older than what could be in the RC table // 6h tolerance because the RC might not be cleaned out regularly wfProfileOut( __METHOD__ ); @@ -1079,7 +1111,9 @@ class Article implements Page { __METHOD__ ); - if ( $oldestRevisionTimestamp && RecentChange::isInRCLifespan( $oldestRevisionTimestamp, 21600 ) ) { + if ( $oldestRevisionTimestamp + && RecentChange::isInRCLifespan( $oldestRevisionTimestamp, 21600 ) + ) { // 6h tolerance because the RC might not be cleaned out regularly $rc = RecentChange::newFromConds( array( @@ -1153,7 +1187,9 @@ class Article implements Page { $validUserPage = false; # Show info in user (talk) namespace. Does the user exist? Is he blocked? - if ( $this->getTitle()->getNamespace() == NS_USER || $this->getTitle()->getNamespace() == NS_USER_TALK ) { + if ( $this->getTitle()->getNamespace() == NS_USER + || $this->getTitle()->getNamespace() == NS_USER_TALK + ) { $parts = explode( '/', $this->getTitle()->getText() ); $rootPart = $parts[0]; $user = User::newFromName( $rootPart, false /* allow IP users*/ ); @@ -1446,9 +1482,7 @@ class Article implements Page { // the loop prepends the arrow image before the link, so the first case needs to be outside - /** - * @var $title Title - */ + /** @var $title Title */ $title = array_shift( $target ); if ( $forceKnown ) { @@ -1459,13 +1493,27 @@ class Article implements Page { $nextRedirect = $wgStylePath . '/common/images/nextredirect' . $imageDir . '.png'; $alt = $lang->isRTL() ? '←' : '→'; - // Automatically append redirect=no to each link, since most of them are redirect pages themselves. + + // Automatically append redirect=no to each link, since most of them are + // redirect pages themselves. + /** @var Title $rt */ foreach ( $target as $rt ) { $link .= Html::element( 'img', array( 'src' => $nextRedirect, 'alt' => $alt ) ); if ( $forceKnown ) { - $link .= Linker::linkKnown( $rt, htmlspecialchars( $rt->getFullText(), array(), array( 'redirect' => 'no' ) ) ); + $link .= Linker::linkKnown( + $rt, + htmlspecialchars( $rt->getFullText(), + array(), + array( 'redirect' => 'no' ) + ) + ); } else { - $link .= Linker::link( $rt, htmlspecialchars( $rt->getFullText() ), array(), array( 'redirect' => 'no' ) ); + $link .= Linker::link( + $rt, + htmlspecialchars( $rt->getFullText() ), + array(), + array( 'redirect' => 'no' ) + ); } } @@ -1572,7 +1620,8 @@ class Article implements Page { try { $reason = $this->generateReason( $hasHistory ); } catch ( MWException $e ) { - # if a page is horribly broken, we still want to be able to delete it. so be lenient about errors here. + # if a page is horribly broken, we still want to be able to + # delete it. So be lenient about errors here. wfDebug( "Error while building auto delete summary: $e" ); $reason = ''; } @@ -1594,7 +1643,11 @@ class Article implements Page { if ( $this->mTitle->isBigDeletion() ) { global $wgDeleteRevisionsLimit; $this->getContext()->getOutput()->wrapWikiMsg( "
\n$1\n
\n", - array( 'delete-warning-toobig', $this->getContext()->getLanguage()->formatNum( $wgDeleteRevisionsLimit ) ) ); + array( + 'delete-warning-toobig', + $this->getContext()->getLanguage()->formatNum( $wgDeleteRevisionsLimit ) + ) + ); } } @@ -1647,9 +1700,14 @@ class Article implements Page { Xml::label( wfMessage( 'deletecomment' )->text(), 'wpDeleteReasonList' ) . " " . - Xml::listDropDown( 'wpDeleteReasonList', + Xml::listDropDown( + 'wpDeleteReasonList', wfMessage( 'deletereason-dropdown' )->inContentLanguage()->text(), - wfMessage( 'deletereasonotherlist' )->inContentLanguage()->text(), '', 'wpReasonDropDown', 1 ) . + wfMessage( 'deletereasonotherlist' )->inContentLanguage()->text(), + '', + 'wpReasonDropDown', + 1 + ) . " @@ -1690,7 +1748,10 @@ class Article implements Page { " . Xml::closeElement( 'table' ) . Xml::closeElement( 'fieldset' ) . - Html::hidden( 'wpEditToken', $user->getEditToken( array( 'delete', $this->getTitle()->getPrefixedText() ) ) ) . + Html::hidden( + 'wpEditToken', + $user->getEditToken( array( 'delete', $this->getTitle()->getPrefixedText() ) ) + ) . Xml::closeElement( 'form' ); if ( $user->isAllowed( 'editinterface' ) ) { @@ -1715,13 +1776,14 @@ class Article implements Page { /** * Perform a deletion and output success or failure messages - * @param $reason - * @param $suppress bool + * @param string $reason + * @param bool $suppress */ public function doDelete( $reason, $suppress = false ) { $error = ''; $outputPage = $this->getContext()->getOutput(); $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0, true, $error ); + if ( $status->isGood() ) { $deleted = $this->getTitle()->getPrefixedText(); @@ -1733,7 +1795,11 @@ class Article implements Page { $outputPage->addWikiMsg( 'deletedtext', wfEscapeWikiText( $deleted ), $loglink ); $outputPage->returnToMain( false ); } else { - $outputPage->setPageTitle( wfMessage( 'cannotdelete-title', $this->getTitle()->getPrefixedText() ) ); + $outputPage->setPageTitle( + wfMessage( 'cannotdelete-title', + $this->getTitle()->getPrefixedText() ) + ); + if ( $error == '' ) { $outputPage->addWikiText( "
\n" . $status->getWikiText() . "\n
" @@ -1878,7 +1944,8 @@ class Article implements Page { if ( $this->mContext instanceof IContextSource ) { return $this->mContext; } else { - wfDebug( __METHOD__ . " called and \$mContext is null. Return RequestContext::getMain(); for sanity\n" ); + wfDebug( __METHOD__ . " called and \$mContext is null. " . + "Return RequestContext::getMain(); for sanity\n" ); return RequestContext::getMain(); } } @@ -1978,7 +2045,9 @@ class Article implements Page { * @param $user User * @return Status */ - public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, $reason, User $user ) { + public function doUpdateRestrictions( array $limit, array $expiry, &$cascade, + $reason, User $user + ) { return $this->mPage->doUpdateRestrictions( $limit, $expiry, $cascade, $reason, $user ); } @@ -1989,7 +2058,9 @@ class Article implements Page { * @param $expiry array * @return bool */ - public function updateRestrictions( $limit = array(), $reason = '', &$cascade = 0, $expiry = array() ) { + public function updateRestrictions( $limit = array(), $reason = '', + &$cascade = 0, $expiry = array() + ) { return $this->mPage->doUpdateRestrictions( $limit, $expiry, @@ -2007,7 +2078,9 @@ class Article implements Page { * @param $error string * @return bool */ - public function doDeleteArticle( $reason, $suppress = false, $id = 0, $commit = true, &$error = '' ) { + public function doDeleteArticle( $reason, $suppress = false, $id = 0, + $commit = true, &$error = '' + ) { return $this->mPage->doDeleteArticle( $reason, $suppress, $id, $commit, $error ); } diff --git a/includes/Autopromote.php b/includes/Autopromote.php index 170d7abfdf..197ad9c957 100644 --- a/includes/Autopromote.php +++ b/includes/Autopromote.php @@ -197,7 +197,8 @@ class Autopromote { return in_array( 'bot', User::getGroupPermissions( $user->getGroups() ) ); default: $result = null; - wfRunHooks( 'AutopromoteCondition', array( $cond[0], array_slice( $cond, 1 ), $user, &$result ) ); + wfRunHooks( 'AutopromoteCondition', array( $cond[0], + array_slice( $cond, 1 ), $user, &$result ) ); if ( $result === null ) { throw new MWException( "Unrecognized condition {$cond[0]} for autopromotion!" ); } diff --git a/includes/Block.php b/includes/Block.php index 3575b9d02a..c366052b58 100644 --- a/includes/Block.php +++ b/includes/Block.php @@ -435,7 +435,8 @@ class Block { * Update a block in the DB with new parameters. * The ID field needs to be loaded first. * - * @return bool|array False on failure, array on success: ('id' => block ID, 'autoIds' => array of autoblock IDs) + * @return bool|array False on failure, array on success: + * ('id' => block ID, 'autoIds' => array of autoblock IDs) */ public function update() { wfDebug( "Block::update; timestamp {$this->mTimestamp}\n" ); @@ -676,7 +677,8 @@ class Block { wfDebug( "Autoblocking {$this->getTarget()}@" . $autoblockIP . "\n" ); $autoblock->setTarget( $autoblockIP ); $autoblock->setBlocker( $this->getBlocker() ); - $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason )->inContentLanguage()->plain(); + $autoblock->mReason = wfMessage( 'autoblocker', $this->getTarget(), $this->mReason ) + ->inContentLanguage()->plain(); $timestamp = wfTimestampNow(); $autoblock->mTimestamp = $timestamp; $autoblock->mAuto = 1; @@ -973,7 +975,10 @@ class Block { # passed by some callers (bug 29116) return null; - } elseif ( in_array( $type, array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) ) { + } elseif ( in_array( + $type, + array( Block::TYPE_USER, Block::TYPE_IP, Block::TYPE_RANGE, null ) ) + ) { $block = new Block(); $block->fromMaster( $fromMaster ); diff --git a/includes/CacheHelper.php b/includes/CacheHelper.php index f6cd3a6914..cfa4160e4c 100644 --- a/includes/CacheHelper.php +++ b/includes/CacheHelper.php @@ -28,7 +28,6 @@ * @since 1.20 */ interface ICacheHelper { - /** * Sets if the cache should be enabled or not. * @@ -81,7 +80,6 @@ interface ICacheHelper { * @param integer $cacheExpiry */ function setExpiry( $cacheExpiry ); - } /** @@ -103,7 +101,6 @@ interface ICacheHelper { * @since 1.20 */ class CacheHelper implements ICacheHelper { - /** * The time to live for the cache, in seconds or a unix timestamp indicating the point of expiry. * @@ -275,7 +272,8 @@ class CacheHelper implements ICacheHelper { $itemKey = array_shift( $itemKey ); if ( !is_integer( $itemKey ) ) { - wfWarn( "Attempted to get item with non-numeric key while the next item in the queue has a key ($itemKey) in " . __METHOD__ ); + wfWarn( "Attempted to get item with non-numeric key while " . + "the next item in the queue has a key ($itemKey) in " . __METHOD__ ); } elseif ( is_null( $itemKey ) ) { wfWarn( "Attempted to get an item while the queue is empty in " . __METHOD__ ); } else { @@ -316,7 +314,11 @@ class CacheHelper implements ICacheHelper { */ public function saveCache() { if ( $this->cacheEnabled && $this->hasCached === false && !empty( $this->cachedChunks ) ) { - wfGetCache( CACHE_ANYTHING )->set( $this->getCacheKeyString(), $this->cachedChunks, $this->cacheExpiry ); + wfGetCache( CACHE_ANYTHING )->set( + $this->getCacheKeyString(), + $this->cachedChunks, + $this->cacheExpiry + ); } } @@ -381,5 +383,4 @@ class CacheHelper implements ICacheHelper { public function setOnInitializedHandler( $handlerFunction ) { $this->onInitHandler = $handlerFunction; } - } diff --git a/includes/Category.php b/includes/Category.php index df5ad7dca5..e326ce23cd 100644 --- a/includes/Category.php +++ b/includes/Category.php @@ -26,7 +26,7 @@ * like to refresh link counts, the objects will be appropriately reinitialized. * Member variables are lazy-initialized. * - * TODO: Move some stuff from CategoryPage.php to here, and use that. + * @todo Move some stuff from CategoryPage.php to here, and use that. */ class Category { /** Name of the category, normalized to DB-key form */ @@ -75,7 +75,8 @@ class Category { if ( !$row ) { # Okay, there were no contents. Nothing to initialize. if ( $this->mTitle ) { - # If there is a title object but no record in the category table, treat this as an empty category + # If there is a title object but no record in the category table, + # treat this as an empty category. $this->mID = false; $this->mName = $this->mTitle->getDBkey(); $this->mPages = 0; @@ -155,11 +156,13 @@ class Category { /** * Factory function, for constructing a Category object from a result set * - * @param $row result set row, must contain the cat_xxx fields. If the fields are null, - * the resulting Category object will represent an empty category if a title object - * was given. If the fields are null and no title was given, this method fails and returns false. - * @param Title $title optional title object for the category represented by the given row. - * May be provided if it is already known, to avoid having to re-create a title object later. + * @param $row Result set row, must contain the cat_xxx fields. If the + * fields are null, the resulting Category object will represent an empty + * category if a title object was given. If the fields are null and no + * title was given, this method fails and returns false. + * @param Title $title optional title object for the category represented by + * the given row. May be provided if it is already known, to avoid having + * to re-create a title object later. * @return Category */ public static function newFromRow( $row, $title = null ) { @@ -177,7 +180,8 @@ class Category { # but we can't know that here... return false; } else { - $cat->mName = $title->getDBkey(); # if we have a title object, fetch the category name from there + # if we have a title object, fetch the category name from there + $cat->mName = $title->getDBkey(); } $cat->mID = false; diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 4027bef09f..183c5f25a4 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -76,7 +76,9 @@ class CategoryViewer extends ContextSource { * @param array $until An array with 3 keys for until of each section (since 1.17) * @param $query Array */ - function __construct( $title, IContextSource $context, $from = array(), $until = array(), $query = array() ) { + function __construct( $title, IContextSource $context, $from = array(), + $until = array(), $query = array() + ) { global $wgCategoryPagingLimit; $this->title = $title; $this->setContext( $context ); @@ -423,7 +425,12 @@ class CategoryViewer extends ContextSource { $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' ); $r .= "
\n"; - $r .= '

' . $this->msg( 'category-media-header', wfEscapeWikiText( $this->title->getText() ) )->text() . "

\n"; + $r .= '

' . + $this->msg( + 'category-media-header', + wfEscapeWikiText( $this->title->getText() ) + )->text() . + "

\n"; $r .= $countmsg; $r .= $this->getSectionPagingLinks( 'file' ); if ( $this->showGallery ) { @@ -447,7 +454,9 @@ class CategoryViewer extends ContextSource { private function getSectionPagingLinks( $type ) { if ( isset( $this->until[$type] ) && $this->until[$type] !== null ) { return $this->pagingLinks( $this->nextPage[$type], $this->until[$type], $type ); - } elseif ( $this->nextPage[$type] !== null || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) ) { + } elseif ( $this->nextPage[$type] !== null + || ( isset( $this->from[$type] ) && $this->from[$type] !== null ) + ) { return $this->pagingLinks( $this->from[$type], $this->nextPage[$type], $type ); } else { return ''; @@ -562,7 +571,8 @@ class CategoryViewer extends ContextSource { static function shortList( $articles, $articles_start_char ) { $r = '

' . htmlspecialchars( $articles_start_char[0] ) . "

\n"; $r .= '

" . htmlspecialchars( $articles_start_char[$index] ) . "

\n