r18914 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18913‎ | r18914 | r18915 >
Date:06:59, 7 January 2007
Author:brion
Status:old
Tags:
Comment:
don't mix braced and non-braced blocks; it's ugly and error-prone
Modified paths:
  • /trunk/phase3/includes/SpecialVersion.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialVersion.php
@@ -235,12 +235,12 @@
236236 function listToText( $list ) {
237237 $cnt = count( $list );
238238
239 - if ( $cnt == 1 )
 239+ if ( $cnt == 1 ) {
240240 // Enforce always returning a string
241241 return (string)$this->arrayToString( $list[0] );
242 - elseif ( $cnt == 0 )
 242+ } elseif ( $cnt == 0 ) {
243243 return '';
244 - else {
 244+ } else {
245245 $t = array_slice( $list, 0, $cnt - 1 );
246246 $one = array_map( array( &$this, 'arrayToString' ), $t );
247247 $two = $this->arrayToString( $list[$cnt - 1] );
@@ -257,9 +257,9 @@
258258 * @return mixed
259259 */
260260 function arrayToString( $list ) {
261 - if ( ! is_array( $list ) )
 261+ if ( ! is_array( $list ) ) {
262262 return $list;
263 - else {
 263+ } else {
264264 $class = get_class( $list[0] );
265265 return "($class, {$list[1]})";
266266 }