r93175 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93174‎ | r93175 | r93176 >
Date:13:34, 26 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Whitespace/braces

Minor documentation addition
Modified paths:
  • /trunk/extensions/Sort/Sort.class.php (modified) (history)
  • /trunk/extensions/Sort/Sort.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Sort/Sort.class.php
@@ -12,7 +12,7 @@
1313 class Sorter {
1414
1515 private $parser = null;
16 -
 16+
1717 private $order = 'asc';
1818 private $class = 'ul';
1919
@@ -37,8 +37,9 @@
3838 $value = strtolower( $value );
3939 switch( $name ) {
4040 case 'class':
41 - if( $value == 'ul' || $value == 'ol' )
 41+ if( $value == 'ul' || $value == 'ol' ) {
4242 $this->class = $value;
 43+ }
4344 break;
4445 case 'order':
4546 $this->order = $value == 'desc'
@@ -77,8 +78,9 @@
7879 $lines[ $line ] = $this->stripWikiTokens( $line );
7980 }
8081 natsort( $lines );
81 - if( $this->order == 'desc' )
 82+ if( $this->order == 'desc' ) {
8283 $lines = array_reverse( $lines, true );
 84+ }
8385 wfProfileOut( __METHOD__ );
8486 return array_keys( $lines );
8587 }
@@ -103,9 +105,11 @@
104106 protected function makeList( $lines ) {
105107 $list = array();
106108 $token = $this->class == 'ul' ? '*' : '#';
107 - foreach( $lines as $line )
108 - if( strlen( $line ) > 0 )
 109+ foreach( $lines as $line ) {
 110+ if( strlen( $line ) > 0 ) {
109111 $list[] = "{$token} {$line}";
 112+ }
 113+ }
110114 return trim( implode( "\n", $list ) );
111115 }
112116
@@ -123,4 +127,4 @@
124128 return $output->getText();
125129 }
126130
127 -}
\ No newline at end of file
 131+}
Index: trunk/extensions/Sort/Sort.php
@@ -27,6 +27,8 @@
2828
2929 /**
3030 * Register hook function
 31+ *
 32+ * @param $parser Parser
3133 */
3234 function efSortSetHook( $parser ) {
3335 $parser->setHook( 'sort', 'efRenderSort' );

Status & tagging log