r81996 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r81995‎ | r81996 | r81997 >
Date:22:04, 11 February 2011
Author:reedy
Status:ok
Tags:
Comment:
Parameter documentation

Parameter documentation

Remove extra return true;
Modified paths:
  • /trunk/extensions/DoubleWiki/DoubleWiki_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DoubleWiki/DoubleWiki_body.php
@@ -48,9 +48,11 @@
4949 return true;
5050 }
5151
52 - /*
 52+ /**
5353 * Hook function called with &match=lang
5454 * Transform $text into a bilingual version
 55+ * @param $parserOutput ParserOutput
 56+ * @param $text
5557 */
5658 function addMatchedText ( &$parserOutput , &$text ) {
5759
@@ -105,7 +107,6 @@
106108 $text = $this->matchColumns ( $text, $myLanguage, $myURL, $wgContLanguageCode,
107109 $translation, $languageName, $url, $match_request );
108110 }
109 - return true;
110111 }
111112 }
112113 return true;
@@ -123,7 +124,7 @@
124125 $left_chunk = '';
125126 $right_chunk = '';
126127
127 - for ( $i=0 ; $i < count($left_slices) ; $i++ ) {
 128+ for ( $i=0 ; $i < count( $left_slices ); $i++ ) {
128129
129130 // some slices might be empty
130131 if( $left_slices[$i] == '' ) {
@@ -205,7 +206,7 @@
206207 preg_match_all( $this->tags, $text, $m, PREG_SET_ORDER);
207208 $counter = 0;
208209 $out = '';
209 - for($i=0; $i < count($m); $i++){
 210+ for( $i = 0; $i < count( $m ); $i++ ){
210211 $t = $m[$i][0];
211212 if( substr( $t, 0, 2) != "</" ) {
212213 $counter++;
@@ -213,12 +214,12 @@
214215 $counter--;
215216 }
216217 $out .= $bits[$i] . $t;
217 - if( ($t == "</p>" || $t == "</dl>" ) && $counter==0 ) {
 218+ if( ( $t == "</p>" || $t == "</dl>" ) && $counter == 0 ) {
218219 $result[] = $out;
219220 $out = '';
220221 }
221222 }
222 - if($out) {
 223+ if( $out ) {
223224 $result[] = $out;
224225 }
225226 return $result;
@@ -239,7 +240,7 @@
240241 * Make slices that are full paragraphs
241242 * If two slices correspond to the same paragraph, the second one will be empty
242243 */
243 - for ( $i=0 ; $i < $n - 1 ; $i++ ) {
 244+ for ( $i=0; $i < $n - 1; $i++ ) {
244245 $str = $left_slices[$i];
245246 $m = array();
246247 if ( preg_match("/(.*)<(p|dl)>/is", $str, $m ) ) {
@@ -256,7 +257,7 @@
257258 $stack = array();
258259 $opening = '';
259260
260 - for( $i=0 ; $i < $n ; $i++) {
 261+ for( $i = 0; $i < $n; $i++ ) {
261262 $m = array();
262263 preg_match_all( $this->tags, $left_slices[$i], $m, PREG_SET_ORDER);
263264 $counter = 0;
@@ -270,7 +271,7 @@
271272 $counter--;
272273 }
273274 }
274 - if( $i==0 ) {
 275+ if( $i == 0 ) {
275276 $closure = '';
276277 for( $k=0; $k < $counter ; $k++ ) {
277278 $opening .= "<".$stack[$k][1].">";

Status & tagging log