http://www.mediawiki.org/wiki/Special:Code/MediaWiki/87687

Revision: 87687
Author:   reedy
Date:     2011-05-08 16:48:30 +0000 (Sun, 08 May 2011)
Log Message:
-----------
Documentation

Remove long deprecated isBot()/isSysop() in ApiMain

Modified Paths:
--------------
    trunk/phase3/includes/api/ApiBase.php
    trunk/phase3/includes/api/ApiMain.php

Modified: trunk/phase3/includes/api/ApiBase.php
===================================================================
--- trunk/phase3/includes/api/ApiBase.php       2011-05-08 14:58:33 UTC (rev 
87686)
+++ trunk/phase3/includes/api/ApiBase.php       2011-05-08 16:48:30 UTC (rev 
87687)
@@ -122,6 +122,9 @@
 
        /**
         * Get the name of the module as shown in the profiler log
+        *
+        * @param $db
+        *
         * @return string
         */
        public function getModuleProfileName( $db = false ) {
@@ -401,6 +404,8 @@
        /**
         * Callback for preg_replace_callback() call in makeHelpMsg().
         * Replaces a source file name with a link to ViewVC
+        *
+        * @return string
         */
        public function makeHelpMsg_callback( $matches ) {
                global $wgAutoloadClasses, $wgAutoloadLocalClasses;
@@ -597,7 +602,7 @@
         * @param $titleObj Title the page under consideration
         * @param $userOption String The user option to consider when 
$watchlist=preferences.
         *      If not set will magically default to either watchdefault or 
watchcreations
-        * @returns Boolean
+        * @return bool
         */
        protected function getWatchlistValue ( $watchlist, $titleObj, 
$userOption = null ) {
 
@@ -1181,7 +1186,7 @@
 
        /**
         * Returns whether this module requires a Token to execute
-        * @returns bool
+        * @return bool
         */
        public function needsToken() {
                return false;
@@ -1189,17 +1194,18 @@
 
        /**
         * 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
-        * @returns bool
+        * @return bool
         */
        public function getTokenSalt() {
                return false;
        }
 
        /**
-       * Gets the user for whom to get the watchlist
-       *
-       * @returns User
-       */
+        * Gets the user for whom to get the watchlist
+        *
+        * @param $params array
+        * @return User
+        */
        public function getWatchlistUser( $params ) {
                global $wgUser;
                if ( !is_null( $params['owner'] ) && !is_null( $params['token'] 
) ) {

Modified: trunk/phase3/includes/api/ApiMain.php
===================================================================
--- trunk/phase3/includes/api/ApiMain.php       2011-05-08 14:58:33 UTC (rev 
87686)
+++ trunk/phase3/includes/api/ApiMain.php       2011-05-08 16:48:30 UTC (rev 
87687)
@@ -225,6 +225,8 @@
 
        /**
         * Set how long the response should be cached.
+        *
+        * @param $maxage
         */
        public function setCacheMaxAge( $maxage ) {
                $this->setCacheControl( array(
@@ -315,6 +317,8 @@
        /**
         * Create an instance of an output formatter by its name
         *
+        * @param $format string
+        *
         * @return ApiFormatBase
         */
        public function createPrinterByName( $format ) {
@@ -676,6 +680,8 @@
 
        /**
         * Print results using the current printer
+        *
+        * @param $isError bool
         */
        protected function printResult( $isError ) {
                $this->getResult()->cleanUpUTF8();
@@ -706,6 +712,8 @@
 
        /**
         * See ApiBase for description.
+        *
+        * @return array
         */
        public function getAllowedParams() {
                return array(
@@ -736,6 +744,8 @@
 
        /**
         * See ApiBase for description.
+        *
+        * @return array
         */
        public function getParamDescription() {
                return array(
@@ -752,6 +762,8 @@
 
        /**
         * See ApiBase for description.
+        *
+        * @return array
         */
        public function getDescription() {
                return array(
@@ -782,6 +794,9 @@
                );
        }
 
+       /**
+        * @return array
+        */
        public function getPossibleErrors() {
                return array_merge( parent::getPossibleErrors(), array(
                        array( 'readonlytext' ),
@@ -794,6 +809,7 @@
 
        /**
         * Returns an array of strings with credits for the API
+        * @return array
         */
        protected function getCredits() {
                return array(
@@ -808,8 +824,11 @@
                        'or file a bug report at http://bugzilla.wikimedia.org/'
                );
        }
+
        /**
         * Sets whether the pretty-printer should format *bold* and $italics$
+        *
+        * @param $help bool
         */
        public function setHelp( $help = true ) {
                $this->mPrinter->setHelp( $help );
@@ -817,6 +836,8 @@
 
        /**
         * Override the parent to generate help messages for all available 
modules.
+        *
+        * @return string
         */
        public function makeHelpMsg() {
                global $wgMemc, $wgAPICacheHelpTimeout;
@@ -838,6 +859,9 @@
                return $retval;
        }
 
+       /**
+        * @return mixed|string
+        */
        public function reallyMakeHelpMsg() {
                $this->setHelp();
 
@@ -881,8 +905,8 @@
        }
 
        /**
-        * @param  $module ApiBase
-        * @param  $paramName String What type of request is this? e.g. action, 
query, list, prop, meta, format
+        * @param $module ApiBase
+        * @param $paramName String What type of request is this? e.g. action, 
query, list, prop, meta, format
         * @return string
         */
        public static function makeHelpMsgHeader( $module, $paramName ) {
@@ -894,37 +918,9 @@
                return "* $paramName={$module->getModuleName()} $modulePrefix*";
        }
 
-       private $mIsBot = null;
-       private $mIsSysop = null;
        private $mCanApiHighLimits = null;
 
        /**
-        * Returns true if the currently logged in user is a bot, false 
otherwise
-        * OBSOLETE, use canApiHighLimits() instead
-        */
-       public function isBot() {
-               if ( !isset( $this->mIsBot ) ) {
-                       global $wgUser;
-                       $this->mIsBot = $wgUser->isAllowed( 'bot' );
-               }
-               return $this->mIsBot;
-       }
-
-       /**
-        * Similar to isBot(), this method returns true if the logged in user is
-        * a sysop, and false if not.
-        * OBSOLETE, use canApiHighLimits() instead
-        */
-       public function isSysop() {
-               if ( !isset( $this->mIsSysop ) ) {
-                       global $wgUser;
-                       $this->mIsSysop = in_array( 'sysop', 
$wgUser->getGroups() );
-               }
-
-               return $this->mIsSysop;
-       }
-
-       /**
         * Check whether the current user is allowed to use high limits
         * @return bool
         */
@@ -948,9 +944,11 @@
        /**
         * Returns the version information of this file, plus it includes
         * the versions for all files that are not callable proper API modules
+        *
+        * @return array
         */
        public function getVersion() {
-               $vers = array ();
+               $vers = array();
                $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n    
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/";;
                $vers[] = __CLASS__ . ': $Id$';
                $vers[] = ApiBase::getBaseVersion();
@@ -975,8 +973,8 @@
         * Add or overwrite an output format for this ApiMain. Intended for use 
by extending
         * classes who wish to add to or modify current formatters.
         *
-        * @param $fmtName The identifier for this format.
-        * @param $fmtClass The class implementing this format.
+        * @param $fmtName string The identifier for this format.
+        * @param $fmtClass ApiFormatBase The class implementing this format.
         */
        protected function addFormat( $fmtName, $fmtClass ) {
                $this->mFormats[$fmtName] = $fmtClass;


_______________________________________________
MediaWiki-CVS mailing list
MediaWiki-CVS@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to