r86765 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86764‎ | r86765 | r86766 >
Date:13:29, 23 April 2011
Author:reedy
Status:ok
Tags:
Comment:
Add some more spacing due to long parameter names

Use str_repeat for ease rather than " " etc

Fix MiserMode to MiserMode
Modified paths:
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryLogEvents.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiQueryLogEvents.php
@@ -422,7 +422,7 @@
423423 'dir' => $this->getDirectionDescription( $p ),
424424 'user' => 'Filter entries to those made by the given user',
425425 'title' => 'Filter entries to those related to a page',
426 - 'prefix' => 'Filter entries that start with this prefix. Disabled in MiserMode',
 426+ 'prefix' => 'Filter entries that start with this prefix. Disabled in Miser Mode',
427427 'limit' => 'How many total event entries to return',
428428 'tag' => 'Only list event entries tagged with this tag',
429429 );
Index: trunk/phase3/includes/api/ApiBase.php
@@ -293,7 +293,8 @@
294294
295295 $paramsDescription = $this->getFinalParamDescription();
296296 $msg = '';
297 - $paramPrefix = "\n" . str_repeat( ' ', 19 );
 297+ $paramPrefix = "\n" . str_repeat( ' ', 24 );
 298+ $descWordwrap = "\n" . str_repeat( ' ', 28 );
298299 foreach ( $params as $paramName => $paramSettings ) {
299300 $desc = isset( $paramsDescription[$paramName] ) ? $paramsDescription[$paramName] : '';
300301 if ( is_array( $desc ) ) {
@@ -338,7 +339,7 @@
339340 }
340341 $desc .= $paramPrefix . $nothingPrompt . $prompt;
341342 $choicesstring = implode( ', ', $choices );
342 - $desc .= wordwrap( $choicesstring, 100, "\n " );
 343+ $desc .= wordwrap( $choicesstring, 100, $descWordwrap );
343344 } else {
344345 switch ( $type ) {
345346 case 'namespace':
@@ -388,7 +389,7 @@
389390 $desc .= $paramPrefix . "Default: $default";
390391 }
391392
392 - $msg .= sprintf( " %-14s - %s\n", $this->encodeParamName( $paramName ), $desc );
 393+ $msg .= sprintf( " %-19s - %s\n", $this->encodeParamName( $paramName ), $desc );
393394 }
394395 return $msg;
395396

Status & tagging log