r112290 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112289‎ | r112290 | r112291 >
Date:02:06, 24 February 2012
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Examples can just be a string

So if it's not false, it can be string|array, if it's a string, just put it in an array
Modified paths:
  • /trunk/phase3/includes/api/ApiParamInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParamInfo.php
@@ -147,6 +147,9 @@
148148 $examples = $obj->getExamples();
149149 $retval['allexamples'] = array();
150150 if ( $examples !== false ) {
 151+ if ( is_string( $examples ) ) {
 152+ $examples = array( $examples );
 153+ }
151154 foreach( $examples as $k => $v ) {
152155 if ( strlen( $retval['examples'] ) ) {
153156 $retval['examples'] .= ' ';

Follow-up revisions

RevisionCommit summaryAuthorDate
r112291MFT r112290reedy02:11, 24 February 2012
r112644MFT r112169, r112170, r112172, r112173, r112179, r112184, r112290, r112313reedy21:13, 28 February 2012

Comments

#Comment by MaxSem (talk | contribs)   15:48, 24 February 2012

Might as well simply casted to array, no condition needed.

Status & tagging log