Merge "Making listToText() not break if passed a 1-item list."
[lhc/web/wiklou.git] / includes / api / ApiBase.php
index 77c0fc2..63624cb 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Sep 5, 2006
  *
- * Copyright © 2006, 2010 Yuri Astrakhan <Firstname><Lastname>@gmail.com
+ * Copyright © 2006, 2010 Yuri Astrakhan "<Firstname><Lastname>@gmail.com"
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -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();
@@ -1439,7 +1440,9 @@ abstract class ApiBase extends ContextSource {
        }
 
        /**
-        * Returns whether this module requires a Token to execute
+        * Returns whether this module requires a token to execute
+        * It is used to show possible errors in action=paraminfo
+        * see bug 25248
         * @return bool
         */
        public function needsToken() {
@@ -1447,8 +1450,12 @@ abstract class ApiBase extends ContextSource {
        }
 
        /**
-        * Returns the token salt if there is one, '' if the module doesn't require a salt, else false if the module doesn't need a token
-        * @return bool|string
+        * Returns the token salt if there is one,
+        * '' if the module doesn't require a salt,
+        * else false if the module doesn't need a token
+        * You have also to override needsToken()
+        * Value is passed to User::getEditToken
+        * @return bool|string|array
         */
        public function getTokenSalt() {
                return false;