Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -225,6 +225,8 @@ |
226 | 226 | |
227 | 227 | /** |
228 | 228 | * Set how long the response should be cached. |
| 229 | + * |
| 230 | + * @param $maxage |
229 | 231 | */ |
230 | 232 | public function setCacheMaxAge( $maxage ) { |
231 | 233 | $this->setCacheControl( array( |
— | — | @@ -315,6 +317,8 @@ |
316 | 318 | /** |
317 | 319 | * Create an instance of an output formatter by its name |
318 | 320 | * |
| 321 | + * @param $format string |
| 322 | + * |
319 | 323 | * @return ApiFormatBase |
320 | 324 | */ |
321 | 325 | public function createPrinterByName( $format ) { |
— | — | @@ -676,6 +680,8 @@ |
677 | 681 | |
678 | 682 | /** |
679 | 683 | * Print results using the current printer |
| 684 | + * |
| 685 | + * @param $isError bool |
680 | 686 | */ |
681 | 687 | protected function printResult( $isError ) { |
682 | 688 | $this->getResult()->cleanUpUTF8(); |
— | — | @@ -706,6 +712,8 @@ |
707 | 713 | |
708 | 714 | /** |
709 | 715 | * See ApiBase for description. |
| 716 | + * |
| 717 | + * @return array |
710 | 718 | */ |
711 | 719 | public function getAllowedParams() { |
712 | 720 | return array( |
— | — | @@ -736,6 +744,8 @@ |
737 | 745 | |
738 | 746 | /** |
739 | 747 | * See ApiBase for description. |
| 748 | + * |
| 749 | + * @return array |
740 | 750 | */ |
741 | 751 | public function getParamDescription() { |
742 | 752 | return array( |
— | — | @@ -752,6 +762,8 @@ |
753 | 763 | |
754 | 764 | /** |
755 | 765 | * See ApiBase for description. |
| 766 | + * |
| 767 | + * @return array |
756 | 768 | */ |
757 | 769 | public function getDescription() { |
758 | 770 | return array( |
— | — | @@ -782,6 +794,9 @@ |
783 | 795 | ); |
784 | 796 | } |
785 | 797 | |
| 798 | + /** |
| 799 | + * @return array |
| 800 | + */ |
786 | 801 | public function getPossibleErrors() { |
787 | 802 | return array_merge( parent::getPossibleErrors(), array( |
788 | 803 | array( 'readonlytext' ), |
— | — | @@ -794,6 +809,7 @@ |
795 | 810 | |
796 | 811 | /** |
797 | 812 | * Returns an array of strings with credits for the API |
| 813 | + * @return array |
798 | 814 | */ |
799 | 815 | protected function getCredits() { |
800 | 816 | return array( |
— | — | @@ -808,8 +824,11 @@ |
809 | 825 | 'or file a bug report at http://bugzilla.wikimedia.org/' |
810 | 826 | ); |
811 | 827 | } |
| 828 | + |
812 | 829 | /** |
813 | 830 | * Sets whether the pretty-printer should format *bold* and $italics$ |
| 831 | + * |
| 832 | + * @param $help bool |
814 | 833 | */ |
815 | 834 | public function setHelp( $help = true ) { |
816 | 835 | $this->mPrinter->setHelp( $help ); |
— | — | @@ -817,6 +836,8 @@ |
818 | 837 | |
819 | 838 | /** |
820 | 839 | * Override the parent to generate help messages for all available modules. |
| 840 | + * |
| 841 | + * @return string |
821 | 842 | */ |
822 | 843 | public function makeHelpMsg() { |
823 | 844 | global $wgMemc, $wgAPICacheHelpTimeout; |
— | — | @@ -838,6 +859,9 @@ |
839 | 860 | return $retval; |
840 | 861 | } |
841 | 862 | |
| 863 | + /** |
| 864 | + * @return mixed|string |
| 865 | + */ |
842 | 866 | public function reallyMakeHelpMsg() { |
843 | 867 | $this->setHelp(); |
844 | 868 | |
— | — | @@ -881,8 +905,8 @@ |
882 | 906 | } |
883 | 907 | |
884 | 908 | /** |
885 | | - * @param $module ApiBase |
886 | | - * @param $paramName String What type of request is this? e.g. action, query, list, prop, meta, format |
| 909 | + * @param $module ApiBase |
| 910 | + * @param $paramName String What type of request is this? e.g. action, query, list, prop, meta, format |
887 | 911 | * @return string |
888 | 912 | */ |
889 | 913 | public static function makeHelpMsgHeader( $module, $paramName ) { |
— | — | @@ -894,37 +918,9 @@ |
895 | 919 | return "* $paramName={$module->getModuleName()} $modulePrefix*"; |
896 | 920 | } |
897 | 921 | |
898 | | - private $mIsBot = null; |
899 | | - private $mIsSysop = null; |
900 | 922 | private $mCanApiHighLimits = null; |
901 | 923 | |
902 | 924 | /** |
903 | | - * Returns true if the currently logged in user is a bot, false otherwise |
904 | | - * OBSOLETE, use canApiHighLimits() instead |
905 | | - */ |
906 | | - public function isBot() { |
907 | | - if ( !isset( $this->mIsBot ) ) { |
908 | | - global $wgUser; |
909 | | - $this->mIsBot = $wgUser->isAllowed( 'bot' ); |
910 | | - } |
911 | | - return $this->mIsBot; |
912 | | - } |
913 | | - |
914 | | - /** |
915 | | - * Similar to isBot(), this method returns true if the logged in user is |
916 | | - * a sysop, and false if not. |
917 | | - * OBSOLETE, use canApiHighLimits() instead |
918 | | - */ |
919 | | - public function isSysop() { |
920 | | - if ( !isset( $this->mIsSysop ) ) { |
921 | | - global $wgUser; |
922 | | - $this->mIsSysop = in_array( 'sysop', $wgUser->getGroups() ); |
923 | | - } |
924 | | - |
925 | | - return $this->mIsSysop; |
926 | | - } |
927 | | - |
928 | | - /** |
929 | 925 | * Check whether the current user is allowed to use high limits |
930 | 926 | * @return bool |
931 | 927 | */ |
— | — | @@ -948,9 +944,11 @@ |
949 | 945 | /** |
950 | 946 | * Returns the version information of this file, plus it includes |
951 | 947 | * the versions for all files that are not callable proper API modules |
| 948 | + * |
| 949 | + * @return array |
952 | 950 | */ |
953 | 951 | public function getVersion() { |
954 | | - $vers = array (); |
| 952 | + $vers = array(); |
955 | 953 | $vers[] = 'MediaWiki: ' . SpecialVersion::getVersion() . "\n http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/"; |
956 | 954 | $vers[] = __CLASS__ . ': $Id$'; |
957 | 955 | $vers[] = ApiBase::getBaseVersion(); |
— | — | @@ -975,8 +973,8 @@ |
976 | 974 | * Add or overwrite an output format for this ApiMain. Intended for use by extending |
977 | 975 | * classes who wish to add to or modify current formatters. |
978 | 976 | * |
979 | | - * @param $fmtName The identifier for this format. |
980 | | - * @param $fmtClass The class implementing this format. |
| 977 | + * @param $fmtName string The identifier for this format. |
| 978 | + * @param $fmtClass ApiFormatBase The class implementing this format. |
981 | 979 | */ |
982 | 980 | protected function addFormat( $fmtName, $fmtClass ) { |
983 | 981 | $this->mFormats[$fmtName] = $fmtClass; |
Index: trunk/phase3/includes/api/ApiBase.php |
— | — | @@ -122,6 +122,9 @@ |
123 | 123 | |
124 | 124 | /** |
125 | 125 | * Get the name of the module as shown in the profiler log |
| 126 | + * |
| 127 | + * @param $db |
| 128 | + * |
126 | 129 | * @return string |
127 | 130 | */ |
128 | 131 | public function getModuleProfileName( $db = false ) { |
— | — | @@ -401,6 +404,8 @@ |
402 | 405 | /** |
403 | 406 | * Callback for preg_replace_callback() call in makeHelpMsg(). |
404 | 407 | * Replaces a source file name with a link to ViewVC |
| 408 | + * |
| 409 | + * @return string |
405 | 410 | */ |
406 | 411 | public function makeHelpMsg_callback( $matches ) { |
407 | 412 | global $wgAutoloadClasses, $wgAutoloadLocalClasses; |
— | — | @@ -597,7 +602,7 @@ |
598 | 603 | * @param $titleObj Title the page under consideration |
599 | 604 | * @param $userOption String The user option to consider when $watchlist=preferences. |
600 | 605 | * If not set will magically default to either watchdefault or watchcreations |
601 | | - * @returns Boolean |
| 606 | + * @return bool |
602 | 607 | */ |
603 | 608 | protected function getWatchlistValue ( $watchlist, $titleObj, $userOption = null ) { |
604 | 609 | |
— | — | @@ -1181,7 +1186,7 @@ |
1182 | 1187 | |
1183 | 1188 | /** |
1184 | 1189 | * Returns whether this module requires a Token to execute |
1185 | | - * @returns bool |
| 1190 | + * @return bool |
1186 | 1191 | */ |
1187 | 1192 | public function needsToken() { |
1188 | 1193 | return false; |
— | — | @@ -1189,17 +1194,18 @@ |
1190 | 1195 | |
1191 | 1196 | /** |
1192 | 1197 | * 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 |
1193 | | - * @returns bool |
| 1198 | + * @return bool |
1194 | 1199 | */ |
1195 | 1200 | public function getTokenSalt() { |
1196 | 1201 | return false; |
1197 | 1202 | } |
1198 | 1203 | |
1199 | 1204 | /** |
1200 | | - * Gets the user for whom to get the watchlist |
1201 | | - * |
1202 | | - * @returns User |
1203 | | - */ |
| 1205 | + * Gets the user for whom to get the watchlist |
| 1206 | + * |
| 1207 | + * @param $params array |
| 1208 | + * @return User |
| 1209 | + */ |
1204 | 1210 | public function getWatchlistUser( $params ) { |
1205 | 1211 | global $wgUser; |
1206 | 1212 | if ( !is_null( $params['owner'] ) && !is_null( $params['token'] ) ) { |