Api method documentation tweaks
authorReedy <reedy@wikimedia.org>
Thu, 12 Jul 2012 15:53:00 +0000 (16:53 +0100)
committerReedy <reedy@wikimedia.org>
Thu, 12 Jul 2012 15:53:00 +0000 (16:53 +0100)
Change-Id: I43398b6016f64accf86921c72a6dac5e71e11c34

includes/api/ApiBase.php
includes/api/ApiMain.php
includes/api/ApiPageSet.php
includes/api/ApiQuery.php
includes/api/ApiQueryBase.php

index 77c0fc2..f231081 100644 (file)
@@ -134,7 +134,7 @@ abstract class ApiBase extends ContextSource {
        /**
         * Get the name of the module as shown in the profiler log
         *
-        * @param $db DatabaseBase
+        * @param $db DatabaseBase|bool
         *
         * @return string
         */
@@ -1185,6 +1185,7 @@ abstract class ApiBase extends ContextSource {
         *   automated identification of the error, e.g., 'unknown_action'
         * @param $httpRespCode int HTTP response code
         * @param $extradata array Data to add to the "<error>" element; array in ApiResult format
+        * @throws UsageException
         */
        public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
                Profiler::instance()->close();
index 172a77b..65aaf7d 100644 (file)
@@ -1160,8 +1160,18 @@ class ApiMain extends ApiBase {
 class UsageException extends MWException {
 
        private $mCodestr;
+
+       /**
+        * @var null|array
+        */
        private $mExtraData;
 
+       /**
+        * @param $message string
+        * @param $codestr string
+        * @param $code int
+        * @param $extradata array|null
+        */
        public function __construct( $message, $codestr, $code = 0, $extradata = null ) {
                parent::__construct( $message, $code );
                $this->mCodestr = $codestr;
index e5146eb..4c0596b 100644 (file)
@@ -52,7 +52,7 @@ class ApiPageSet extends ApiQueryBase {
 
        /**
         * Constructor
-        * @param $query ApiQueryBase
+        * @param $query ApiBase
         * @param $resolveRedirects bool Whether redirects should be resolved
         * @param $convertTitles bool
         */
index 866b71c..168bb24 100644 (file)
@@ -103,6 +103,10 @@ class ApiQuery extends ApiBase {
 
        protected $mAllowedGenerators = array();
 
+       /**
+        * @param $main ApiMain
+        * @param $action string
+        */
        public function __construct( $main, $action ) {
                parent::__construct( $main, $action );
 
@@ -202,6 +206,9 @@ class ApiQuery extends ApiBase {
                return null;
        }
 
+       /**
+        * @return ApiFormatRaw|null
+        */
        public function getCustomPrinter() {
                // If &exportnowrap is set, use the raw formatter
                if ( $this->getParameter( 'export' ) &&
@@ -258,6 +265,9 @@ class ApiQuery extends ApiBase {
                $this->outputGeneralPageInfo();
 
                // Execute all requested modules.
+               /**
+                * @var $module ApiQueryBase
+                */
                foreach ( $modules as $module ) {
                        $params = $module->extractRequestParams();
                        $cacheMode = $this->mergeCacheMode(
@@ -303,6 +313,9 @@ class ApiQuery extends ApiBase {
         */
        private function addCustomFldsToPageSet( $modules, $pageSet ) {
                // Query all requested modules.
+               /**
+                * @var $module ApiQueryBase
+                */
                foreach ( $modules as $module ) {
                        $module->requestExtraData( $pageSet );
                }
@@ -384,6 +397,9 @@ class ApiQuery extends ApiBase {
 
                // Show redirect information
                $redirValues = array();
+               /**
+                * @var $titleTo Title
+                */
                foreach ( $pageSet->getRedirectTitles() as $titleStrFrom => $titleTo ) {
                        $r = array(
                                'from' => strval( $titleStrFrom ),
index 92fabdd..0819d86 100644 (file)
@@ -571,6 +571,11 @@ abstract class ApiQueryGeneratorBase extends ApiQueryBase {
 
        private $mIsGenerator;
 
+       /**
+        * @param $query ApiBase
+        * @param $moduleName string
+        * @param $paramPrefix string
+        */
        public function __construct( $query, $moduleName, $paramPrefix = '' ) {
                parent::__construct( $query, $moduleName, $paramPrefix );
                $this->mIsGenerator = false;