r92430 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92429‎ | r92430 | r92431 >
Date:13:19, 18 July 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
* (bug 29935) Improve formatting of examples in ApiParamInfo

Old example string with newlines left for the moment, pending discussion on bug...
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/api/ApiParamInfo.php (modified) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -197,6 +197,7 @@
198198 srprop=sectiontitle
199199 * Correct the documentation of srprop properties
200200 * (bug 28817) Add reference help page link to API Modules
 201+* (bug 29935) Improve formatting of examples in ApiParamInfo
201202
202203 === Languages updated in 1.19 ===
203204
Index: trunk/phase3/includes/api/ApiParamInfo.php
@@ -93,7 +93,8 @@
9494 $result = $this->getResult();
9595 $retval['classname'] = get_class( $obj );
9696 $retval['description'] = implode( "\n", (array)$obj->getDescription() );
97 - $retval['examples'] = implode( "\n", (array)$obj->getExamples() );
 97+ $examples = (array)$obj->getExamples();
 98+ $retval['examples'] = implode( "\n", $examples );
9899 $retval['version'] = implode( "\n", (array)$obj->getVersion() );
99100 $retval['prefix'] = $obj->getModulePrefix();
100101
@@ -118,6 +119,9 @@
119120 $retval['helpurls'] = (array)$obj->getHelpUrls();
120121 $result->setIndexedTagName( $retval['helpurls'], 'helpurl' );
121122
 123+ $retval['allexamples'] = $examples;
 124+ $result->setIndexedTagName( $retval['allexamples'], 'example' );
 125+
122126 $retval['parameters'] = array();
123127 $paramDesc = $obj->getFinalParamDescription();
124128 foreach ( $allowedParams as $n => $p ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r94548Followup r92430 per CR, like r94448reedy18:56, 15 August 2011

Comments

#Comment by Duplicatebug (talk | contribs)   18:50, 15 August 2011

Looks bad, when there are no examples, like api.php?action=paraminfo&pagesetmodule=, having r94448 also for this makes sense. Thanks.

Status & tagging log