From 1ba364df992e9c5f95dd2f762697c1dad5f6961b Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 28 Oct 2011 18:10:41 +0000 Subject: [PATCH] Update documentation Fix some context method calls which were considered deprecated --- includes/api/ApiFormatWddx.php | 2 ++ includes/api/ApiParse.php | 4 ++-- includes/api/ApiQuery.php | 2 ++ includes/api/ApiQueryBase.php | 9 ++++++++- includes/api/ApiQueryInfo.php | 2 +- includes/api/ApiQueryUserContributions.php | 1 + 6 files changed, 16 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiFormatWddx.php b/includes/api/ApiFormatWddx.php index f5cace2139..77fb4cd549 100644 --- a/includes/api/ApiFormatWddx.php +++ b/includes/api/ApiFormatWddx.php @@ -69,6 +69,8 @@ class ApiFormatWddx extends ApiFormatBase { /** * Recursively go through the object and output its data in WDDX format. + * @param $elemValue + * @param $indent int */ function slowWddxPrinter( $elemValue, $indent = 0 ) { $indstr = ( $this->getIsHtml() ? '' : str_repeat( ' ', $indent ) ); diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index cfc2fb208a..b1e344c913 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -259,7 +259,7 @@ class ApiParse extends ApiBase { } if ( isset( $prop['headitems'] ) || isset( $prop['headhtml'] ) ) { - $context = $this->createContext(); + $context = $this->getContext(); $context->setTitle( $titleObj ); $context->getOutput()->addParserOutputNoText( $p_result ); @@ -382,7 +382,7 @@ class ApiParse extends ApiBase { } private function categoriesHtml( $categories ) { - $context = $this->createContext(); + $context = $this->getContext(); $context->getOutput()->addCategoryLinks( $categories ); return $context->getSkin()->getCategories(); } diff --git a/includes/api/ApiQuery.php b/includes/api/ApiQuery.php index d0803f1b31..edeb9c877e 100644 --- a/includes/api/ApiQuery.php +++ b/includes/api/ApiQuery.php @@ -281,6 +281,8 @@ class ApiQuery extends ApiBase { * The cache mode may increase in the level of privacy, but public modules * added to private data do not decrease the level of privacy. * + * @param $cacheMode string + * @param $modCacheMode string * @return string */ protected function mergeCacheMode( $cacheMode, $modCacheMode ) { diff --git a/includes/api/ApiQueryBase.php b/includes/api/ApiQueryBase.php index aa0cb36b71..daadcaad17 100644 --- a/includes/api/ApiQueryBase.php +++ b/includes/api/ApiQueryBase.php @@ -55,6 +55,7 @@ abstract class ApiQueryBase extends ApiBase { * Public caching will only be allowed if *all* the modules that supply * data for a given request return a cache mode of public. * + * @param $params * @return string */ public function getCacheMode( $params ) { @@ -220,14 +221,20 @@ abstract class ApiQueryBase extends ApiBase { } } } + /** * Add a WHERE clause corresponding to a range, similar to addWhereRange, * but converts $start and $end to database timestamps. * @see addWhereRange + * @param $field + * @param $dir + * @param $start + * @param $end + * @param $sort bool */ protected function addTimestampWhereRange( $field, $dir, $start, $end, $sort = true ) { $db = $this->getDb(); - return $this->addWhereRange( $field, $dir, + return $this->addWhereRange( $field, $dir, $db->timestampOrNull( $start ), $db->timestampOrNull( $end ), $sort ); } diff --git a/includes/api/ApiQueryInfo.php b/includes/api/ApiQueryInfo.php index fe98bb31b0..2d42d1a247 100644 --- a/includes/api/ApiQueryInfo.php +++ b/includes/api/ApiQueryInfo.php @@ -76,7 +76,7 @@ class ApiQueryInfo extends ApiQueryBase { * Get an array mapping token names to their handler functions. * The prototype for a token function is func($pageid, $title) * it should return a token or false (permission denied) - * @return array(tokenname => function) + * @return array array(tokenname => function) */ protected function getTokenFunctions() { // Don't call the hooks twice diff --git a/includes/api/ApiQueryUserContributions.php b/includes/api/ApiQueryUserContributions.php index 24b32776e4..842fb0d1d9 100644 --- a/includes/api/ApiQueryUserContributions.php +++ b/includes/api/ApiQueryUserContributions.php @@ -276,6 +276,7 @@ class ApiQueryContributions extends ApiQueryBase { /** * Extract fields from the database row and append them to a result array * + * @param $row * @return array */ private function extractRowInfo( $row ) { -- 2.20.1