Index: trunk/phase3/includes/User.php |
— | — | @@ -169,7 +169,7 @@ |
170 | 170 | var $mId, $mName, $mRealName, $mPassword, $mNewpassword, $mNewpassTime, |
171 | 171 | $mEmail, $mTouched, $mToken, $mEmailAuthenticated, |
172 | 172 | $mEmailToken, $mEmailTokenExpires, $mRegistration, $mGroups, $mOptionOverrides, |
173 | | - $mCookiePassword; |
| 173 | + $mCookiePassword, $mEditCount, $mAllowUsertalk; |
174 | 174 | //@} |
175 | 175 | |
176 | 176 | /** |
— | — | @@ -211,6 +211,10 @@ |
212 | 212 | * @var Block |
213 | 213 | */ |
214 | 214 | var $mBlock; |
| 215 | + |
| 216 | + /** |
| 217 | + * @var Block |
| 218 | + */ |
215 | 219 | private $mBlockedFromCreateAccount = false; |
216 | 220 | |
217 | 221 | static $idCacheByName = array(); |
— | — | @@ -229,6 +233,9 @@ |
230 | 234 | $this->clearInstanceCache( 'defaults' ); |
231 | 235 | } |
232 | 236 | |
| 237 | + /** |
| 238 | + * @return String |
| 239 | + */ |
233 | 240 | function __toString(){ |
234 | 241 | return $this->getName(); |
235 | 242 | } |
— | — | @@ -438,7 +445,6 @@ |
439 | 446 | |
440 | 447 | //@} |
441 | 448 | |
442 | | - |
443 | 449 | /** |
444 | 450 | * Get the username corresponding to a given user ID |
445 | 451 | * @param $id Int User ID |
— | — | @@ -738,6 +744,8 @@ |
739 | 745 | * - 'valid' Valid for batch processes |
740 | 746 | * - 'usable' Valid for batch processes and login |
741 | 747 | * - 'creatable' Valid for batch processes, login and account creation |
| 748 | + * |
| 749 | + * @return bool|string |
742 | 750 | */ |
743 | 751 | public static function getCanonicalName( $name, $validate = 'valid' ) { |
744 | 752 | # Force usernames to capital |
— | — | @@ -848,6 +856,8 @@ |
849 | 857 | * |
850 | 858 | * @note This no longer clears uncached lazy-initialised properties; |
851 | 859 | * the constructor does that instead. |
| 860 | + * |
| 861 | + * @param $name string |
852 | 862 | */ |
853 | 863 | private function loadDefaults( $name = false ) { |
854 | 864 | wfProfileIn( __METHOD__ ); |
— | — | @@ -1159,7 +1169,7 @@ |
1160 | 1170 | |
1161 | 1171 | /** |
1162 | 1172 | * Clear various cached data stored in this object. |
1163 | | - * @param $reloadFrom String Reload user and user_groups table data from a |
| 1173 | + * @param $reloadFrom bool|String Reload user and user_groups table data from a |
1164 | 1174 | * given source. May be "name", "id", "defaults", "session", or false for |
1165 | 1175 | * no reload. |
1166 | 1176 | */ |
— | — | @@ -1349,6 +1359,9 @@ |
1350 | 1360 | |
1351 | 1361 | /** |
1352 | 1362 | * Check if an IP address is in the local proxy list |
| 1363 | + * |
| 1364 | + * @param $ip string |
| 1365 | + * |
1353 | 1366 | * @return bool |
1354 | 1367 | */ |
1355 | 1368 | public static function isLocallyBlockedProxy( $ip ) { |
— | — | @@ -1882,6 +1895,8 @@ |
1883 | 1896 | /** |
1884 | 1897 | * Validate the cache for this account. |
1885 | 1898 | * @param $timestamp String A timestamp in TS_MW format |
| 1899 | + * |
| 1900 | + * @return bool |
1886 | 1901 | */ |
1887 | 1902 | public function validateCache( $timestamp ) { |
1888 | 1903 | $this->load(); |
— | — | @@ -1910,6 +1925,8 @@ |
1911 | 1926 | * |
1912 | 1927 | * @param $str String New password to set |
1913 | 1928 | * @throws PasswordError on failure |
| 1929 | + * |
| 1930 | + * @return bool |
1914 | 1931 | */ |
1915 | 1932 | public function setPassword( $str ) { |
1916 | 1933 | global $wgAuth; |
— | — | @@ -1974,7 +1991,7 @@ |
1975 | 1992 | * Set the random token (used for persistent authentication) |
1976 | 1993 | * Called from loadDefaults() among other places. |
1977 | 1994 | * |
1978 | | - * @param $token String If specified, set the token to this value |
| 1995 | + * @param $token String|bool If specified, set the token to this value |
1979 | 1996 | */ |
1980 | 1997 | public function setToken( $token = false ) { |
1981 | 1998 | global $wgSecretKey, $wgProxyKey; |
— | — | @@ -2218,6 +2235,8 @@ |
2219 | 2236 | |
2220 | 2237 | /** |
2221 | 2238 | * Get the user preferred stub threshold |
| 2239 | + * |
| 2240 | + * @return int |
2222 | 2241 | */ |
2223 | 2242 | public function getStubThreshold() { |
2224 | 2243 | global $wgMaxArticleSize; # Maximum article size, in Kb |
— | — | @@ -2409,8 +2428,11 @@ |
2410 | 2429 | |
2411 | 2430 | /** |
2412 | 2431 | * Check if user is allowed to access a feature / make an action |
2413 | | - * @param varargs String permissions to test |
| 2432 | + * |
| 2433 | + * @internal param \String $varargs permissions to test |
2414 | 2434 | * @return Boolean: True if user is allowed to perform *any* of the given actions |
| 2435 | + * |
| 2436 | + * @return bool |
2415 | 2437 | */ |
2416 | 2438 | public function isAllowedAny( /*...*/ ){ |
2417 | 2439 | $permissions = func_get_args(); |
— | — | @@ -2423,7 +2445,8 @@ |
2424 | 2446 | } |
2425 | 2447 | |
2426 | 2448 | /** |
2427 | | - * @param varargs String |
| 2449 | + * |
| 2450 | + * @internal param $varargs string |
2428 | 2451 | * @return bool True if the user is allowed to perform *all* of the given actions |
2429 | 2452 | */ |
2430 | 2453 | public function isAllowedAll( /*...*/ ){ |
— | — | @@ -2439,7 +2462,7 @@ |
2440 | 2463 | /** |
2441 | 2464 | * Internal mechanics of testing a permission |
2442 | 2465 | * @param $action String |
2443 | | - * @paramn $ns int Namespace optional |
| 2466 | + * @param $ns int|null Namespace optional |
2444 | 2467 | * @return bool |
2445 | 2468 | */ |
2446 | 2469 | public function isAllowed( $action = '', $ns = null ) { |
— | — | @@ -3043,6 +3066,9 @@ |
3044 | 3067 | /** |
3045 | 3068 | * Check if the given clear-text password matches the temporary password |
3046 | 3069 | * sent by e-mail for password reset operations. |
| 3070 | + * |
| 3071 | + * @param $plaintext string |
| 3072 | + * |
3047 | 3073 | * @return Boolean: True if matches, false otherwise |
3048 | 3074 | */ |
3049 | 3075 | public function checkTemporaryPassword( $plaintext ) { |
— | — | @@ -3197,7 +3223,7 @@ |
3198 | 3224 | * @note Call saveSettings() after calling this function to commit |
3199 | 3225 | * this change to the database. |
3200 | 3226 | * |
3201 | | - * @param[out] &$expiration \mixed Accepts the expiration time |
| 3227 | + * @param &$expiration \mixed Accepts the expiration time |
3202 | 3228 | * @return String New token |
3203 | 3229 | */ |
3204 | 3230 | private function confirmationToken( &$expiration ) { |
— | — | @@ -3258,6 +3284,8 @@ |
3259 | 3285 | * Mark the e-mail address confirmed. |
3260 | 3286 | * |
3261 | 3287 | * @note Call saveSettings() after calling this function to commit the change. |
| 3288 | + * |
| 3289 | + * @return true |
3262 | 3290 | */ |
3263 | 3291 | public function confirmEmail() { |
3264 | 3292 | $this->setEmailAuthenticationTimestamp( wfTimestampNow() ); |
— | — | @@ -3397,6 +3425,8 @@ |
3398 | 3426 | * Get the permissions associated with a given list of groups |
3399 | 3427 | * |
3400 | 3428 | * @param $groups Array of Strings List of internal group names |
| 3429 | + * @param $ns int |
| 3430 | + * |
3401 | 3431 | * @return Array of Strings List of permission key names for given groups combined |
3402 | 3432 | */ |
3403 | 3433 | public static function getGroupPermissions( $groups, $ns = null ) { |
— | — | @@ -3423,8 +3453,8 @@ |
3424 | 3454 | |
3425 | 3455 | /** |
3426 | 3456 | * Helper for User::getGroupPermissions |
3427 | | - * @param array $list |
3428 | | - * @param int $ns |
| 3457 | + * @param $list array |
| 3458 | + * @param $ns int |
3429 | 3459 | * @return array |
3430 | 3460 | */ |
3431 | 3461 | private static function extractRights( $list, $ns ) { |
— | — | @@ -3449,6 +3479,9 @@ |
3450 | 3480 | * Get all the groups who have a given permission |
3451 | 3481 | * |
3452 | 3482 | * @param $role String Role to check |
| 3483 | + * @param $ns int |
| 3484 | + * |
| 3485 | + * |
3453 | 3486 | * @return Array of Strings List of internal group names with the given permission |
3454 | 3487 | */ |
3455 | 3488 | public static function getGroupsWithPermission( $role, $ns = null ) { |
— | — | @@ -3768,7 +3801,8 @@ |
3769 | 3802 | * Make a new-style password hash |
3770 | 3803 | * |
3771 | 3804 | * @param $password String Plain-text password |
3772 | | - * @param $salt String Optional salt, may be random or the user ID. |
| 3805 | + * @param bool|string $salt Optional salt, may be random or the user ID. |
| 3806 | + |
3773 | 3807 | * If unspecified or false, will generate one automatically |
3774 | 3808 | * @return String Password hash |
3775 | 3809 | */ |
— | — | @@ -3796,8 +3830,9 @@ |
3797 | 3831 | * |
3798 | 3832 | * @param $hash String Password hash |
3799 | 3833 | * @param $password String Plain-text password to compare |
3800 | | - * @param $userId String User ID for old-style password salt |
3801 | | - * @return Boolean: |
| 3834 | + * @param $userId String|bool User ID for old-style password salt |
| 3835 | + * |
| 3836 | + * @return Boolean |
3802 | 3837 | */ |
3803 | 3838 | public static function comparePasswords( $hash, $password, $userId = false ) { |
3804 | 3839 | $type = substr( $hash, 0, 3 ); |
— | — | @@ -3873,6 +3908,9 @@ |
3874 | 3909 | return true; |
3875 | 3910 | } |
3876 | 3911 | |
| 3912 | + /** |
| 3913 | + * @todo document |
| 3914 | + */ |
3877 | 3915 | protected function loadOptions() { |
3878 | 3916 | $this->load(); |
3879 | 3917 | if ( $this->mOptionsLoaded || !$this->getId() ) |
— | — | @@ -3909,6 +3947,9 @@ |
3910 | 3948 | wfRunHooks( 'UserLoadOptions', array( $this, &$this->mOptions ) ); |
3911 | 3949 | } |
3912 | 3950 | |
| 3951 | + /** |
| 3952 | + * @todo document |
| 3953 | + */ |
3913 | 3954 | protected function saveOptions() { |
3914 | 3955 | global $wgAllowPrefChange; |
3915 | 3956 | |
— | — | @@ -3923,8 +3964,9 @@ |
3924 | 3965 | |
3925 | 3966 | // Allow hooks to abort, for instance to save to a global profile. |
3926 | 3967 | // Reset options to default state before saving. |
3927 | | - if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) |
| 3968 | + if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) { |
3928 | 3969 | return; |
| 3970 | + } |
3929 | 3971 | |
3930 | 3972 | foreach( $saveOptions as $key => $value ) { |
3931 | 3973 | # Don't bother storing default values |
Index: trunk/phase3/includes/db/Database.php |
— | — | @@ -1011,7 +1011,7 @@ |
1012 | 1012 | * @param $fname string The function name of the caller. |
1013 | 1013 | * @param $options string|array The query options. See DatabaseBase::select() for details. |
1014 | 1014 | * |
1015 | | - * @return The value from the field, or false on failure. |
| 1015 | + * @return false|mixed The value from the field, or false on failure. |
1016 | 1016 | */ |
1017 | 1017 | function selectField( $table, $var, $cond = '', $fname = 'DatabaseBase::selectField', |
1018 | 1018 | $options = array() ) |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -236,7 +236,7 @@ |
237 | 237 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCodeReviewSchemaUpdates'; |
238 | 238 | |
239 | 239 | /** |
240 | | - * @param $updater DatabaseUpdater |
| 240 | + * @param $updater DatabaseUpdater |
241 | 241 | * @return bool |
242 | 242 | */ |
243 | 243 | function efCodeReviewSchemaUpdates( $updater ) { |