r101160 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101159‎ | r101160 | r101161 >
Date:18:10, 28 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Update documentation

Fix some context method calls which were considered deprecated
Modified paths:
  • /trunk/phase3/includes/api/ApiFormatWddx.php (modified) (history)
  • /trunk/phase3/includes/api/ApiParse.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQuery.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryInfo.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryUserContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiParse.php
@@ -259,7 +259,7 @@
260260 }
261261
262262 if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) {
263 - $context = $this->createContext();
 263+ $context = $this->getContext();
264264 $context->setTitle( $titleObj );
265265 $context->getOutput()->addParserOutputNoText( $p_result );
266266
@@ -382,7 +382,7 @@
383383 }
384384
385385 private function categoriesHtml( $categories ) {
386 - $context = $this->createContext();
 386+ $context = $this->getContext();
387387 $context->getOutput()->addCategoryLinks( $categories );
388388 return $context->getSkin()->getCategories();
389389 }
Index: trunk/phase3/includes/api/ApiFormatWddx.php
@@ -69,6 +69,8 @@
7070
7171 /**
7272 * Recursively go through the object and output its data in WDDX format.
 73+ * @param $elemValue
 74+ * @param $indent int
7375 */
7476 function slowWddxPrinter( $elemValue, $indent = 0 ) {
7577 $indstr = ( $this->getIsHtml() ? '' : str_repeat( ' ', $indent ) );
Index: trunk/phase3/includes/api/ApiQueryBase.php
@@ -55,6 +55,7 @@
5656 * Public caching will only be allowed if *all* the modules that supply
5757 * data for a given request return a cache mode of public.
5858 *
 59+ * @param $params
5960 * @return string
6061 */
6162 public function getCacheMode( $params ) {
@@ -220,14 +221,20 @@
221222 }
222223 }
223224 }
 225+
224226 /**
225227 * Add a WHERE clause corresponding to a range, similar to addWhereRange,
226228 * but converts $start and $end to database timestamps.
227229 * @see addWhereRange
 230+ * @param $field
 231+ * @param $dir
 232+ * @param $start
 233+ * @param $end
 234+ * @param $sort bool
228235 */
229236 protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) {
230237 $db = $this->getDb();
231 - return $this->addWhereRange( $field, $dir,
 238+ return $this->addWhereRange( $field, $dir,
232239 $db->timestampOrNull( $start ), $db->timestampOrNull( $end ), $sort );
233240 }
234241
Index: trunk/phase3/includes/api/ApiQuery.php
@@ -281,6 +281,8 @@
282282 * The cache mode may increase in the level of privacy, but public modules
283283 * added to private data do not decrease the level of privacy.
284284 *
 285+ * @param $cacheMode string
 286+ * @param $modCacheMode string
285287 * @return string
286288 */
287289 protected function mergeCacheMode( $cacheMode, $modCacheMode ) {
Index: trunk/phase3/includes/api/ApiQueryInfo.php
@@ -76,7 +76,7 @@
7777 * Get an array mapping token names to their handler functions.
7878 * The prototype for a token function is func($pageid, $title)
7979 * it should return a token or false (permission denied)
80 - * @return array(tokenname => function)
 80+ * @return array array(tokenname => function)
8181 */
8282 protected function getTokenFunctions() {
8383 // Don't call the hooks twice
Index: trunk/phase3/includes/api/ApiQueryUserContributions.php
@@ -276,6 +276,7 @@
277277 /**
278278 * Extract fields from the database row and append them to a result array
279279 *
 280+ * @param $row
280281 * @return array
281282 */
282283 private function extractRowInfo( $row ) {

Status & tagging log