r87456 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87455‎ | r87456 | r87457 >
Date:21:24, 4 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Fleshed out function level documentation
Modified paths:
  • /trunk/extensions/ApiSandbox/SpecialApiSandbox.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ApiSandbox/SpecialApiSandbox.php
@@ -1,6 +1,10 @@
22 <?php
33
44 class SpecialApiSandbox extends SpecialPage {
 5+
 6+ /**
 7+ * @var ApiQuery
 8+ */
59 private $apiQuery;
610 /**
711 * Constructor
@@ -49,6 +53,9 @@
5054 $out->addHTML( "\n</div>" ); # <div id="api-sandbox-content">
5155 }
5256
 57+ /**
 58+ * @return string
 59+ */
5360 private function getInputs() {
5461 global $wgEnableWriteAPI;
5562
@@ -94,6 +101,10 @@
95102 return $s;
96103 }
97104
 105+ /**
 106+ * @param $type string
 107+ * @return array
 108+ */
98109 private function getQueryModules( $type ) {
99110 $res = array();
100111 $params = $this->apiQuery->getAllowedParams();
@@ -115,6 +126,12 @@
116127 return $res;
117128 }
118129
 130+ /**
 131+ * @param $name string
 132+ * @param $items array
 133+ * @param $default bool
 134+ * @return string
 135+ */
119136 private static function getSelect( $name, $items, $default = false ) {
120137 $s = Html::openElement( 'select', array(
121138 'class' => 'api-sandbox-input',
@@ -144,11 +161,21 @@
145162 return $s;
146163 }
147164
 165+ /**
 166+ * @param $value string
 167+ * @param $text string
 168+ * @param $attributes array
 169+ * @return string
 170+ */
148171 private static function option( $value, $text, $attributes = array() ) {
149172 $attributes['value'] = $value;
150173 return Html::element( 'option', $attributes, $text );
151174 }
152175
 176+ /**
 177+ * @param $name string
 178+ * @return string
 179+ */
153180 private function openFieldset( $name ) {
154181 return "\n" . Html::openElement( 'fieldset', array( 'id' => "api-sandbox-$name" ) )
155182 . "\n\t" . Html::rawElement( 'legend', array(), wfMessage( "apisb-$name" )->parse() )
@@ -157,6 +184,8 @@
158185
159186 /**
160187 * Callback that returns false if its argument (format name) ends with 'fm'
 188+ *
 189+ * @param $value string
161190 * @return boolean
162191 */
163192 private static function filterFormats( $value ) {

Status & tagging log