diff options
author | Siebrand Mazeland <siebrand@kitano.nl> | 2014-03-23 02:28:57 +0100 |
---|---|---|
committer | Siebrand <siebrand@kitano.nl> | 2014-03-23 01:29:41 +0000 |
commit | 7a635c5dfda079f84370ca8d19fd6ab9fcfc7870 (patch) | |
tree | d5d7f440bf476ff1d76459de23b530737ec63e34 /includes/CategoryViewer.php | |
parent | b0b32b9b7dde76d2214c872bf0b97ec77acd441d (diff) | |
download | mediawikicore-7a635c5dfda079f84370ca8d19fd6ab9fcfc7870.tar.gz mediawikicore-7a635c5dfda079f84370ca8d19fd6ab9fcfc7870.zip |
Try to make a dent in CodeSniffer reports on includes/ (1)
Change-Id: Iaf3120b4e32cc5835ef9ed86236d98679e2b87fa
Diffstat (limited to 'includes/CategoryViewer.php')
-rw-r--r-- | includes/CategoryViewer.php | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index 4027bef09f62..183c5f25a4ac 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 .= "<div id=\"mw-category-media\">\n"; - $r .= '<h2>' . $this->msg( 'category-media-header', wfEscapeWikiText( $this->title->getText() ) )->text() . "</h2>\n"; + $r .= '<h2>' . + $this->msg( + 'category-media-header', + wfEscapeWikiText( $this->title->getText() ) + )->text() . + "</h2>\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 = '<h3>' . htmlspecialchars( $articles_start_char[0] ) . "</h3>\n"; $r .= '<ul><li>' . $articles[0] . '</li>'; - for ( $index = 1; $index < count( $articles ); $index++ ) { + $articleCount = count( $articles ); + for ( $index = 1; $index < $articleCount; $index++ ) { if ( $articles_start_char[$index] != $articles_start_char[$index - 1] ) { $r .= "</ul><h3>" . htmlspecialchars( $articles_start_char[$index] ) . "</h3>\n<ul>"; } |