diff options
Diffstat (limited to 'includes/api/ApiQueryRandom.php')
-rw-r--r-- | includes/api/ApiQueryRandom.php | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/includes/api/ApiQueryRandom.php b/includes/api/ApiQueryRandom.php index b3b840fd..dea0b0f5 100644 --- a/includes/api/ApiQueryRandom.php +++ b/includes/api/ApiQueryRandom.php @@ -1,7 +1,7 @@ <?php /** - * API for MediaWiki 1.8+ + * * * Created on Monday, January 28, 2008 * @@ -36,7 +36,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup API */ - class ApiQueryRandom extends ApiQueryGeneratorBase { +class ApiQueryRandom extends ApiQueryGeneratorBase { public function __construct( $query, $moduleName ) { parent::__construct( $query, $moduleName, 'rn' ); @@ -50,6 +50,14 @@ if ( !defined( 'MEDIAWIKI' ) ) { $this->run( $resultPageSet ); } + /** + * @param $randstr + * @param $limit + * @param $namespace + * @param $resultPageSet ApiPageSet + * @param $redirect + * @return void + */ protected function prepareQuery( $randstr, $limit, $namespace, &$resultPageSet, $redirect ) { $this->resetQueryParams(); $this->addTables( 'page' ); @@ -65,7 +73,11 @@ if ( !defined( 'MEDIAWIKI' ) ) { } } - protected function runQuery( &$resultPageSet ) { + /** + * @param $resultPageSet ApiPageSet + * @return int + */ + protected function runQuery( $resultPageSet = null ) { $res = $this->select( __METHOD__ ); $count = 0; foreach ( $res as $row ) { @@ -92,6 +104,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { return $count; } + /** + * @param $resultPageSet ApiPageSet + * @return void + */ public function run( $resultPageSet = null ) { $params = $this->extractRequestParams(); $result = $this->getResult(); |