r92463 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92462‎ | r92463 | r92464 >
Date:20:11, 18 July 2011
Author:reedy
Status:ok
Tags:
Comment:
Documentation updates

Add a couple of missing explicit class variables
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/phase3/includes/User.php (modified) (history)
  • /trunk/phase3/includes/db/Database.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -169,7 +169,7 @@
170170 var $mId, $mName, $mRealName, $mPassword, $mNewpassword, $mNewpassTime,
171171 $mEmail, $mTouched, $mToken, $mEmailAuthenticated,
172172 $mEmailToken, $mEmailTokenExpires, $mRegistration, $mGroups, $mOptionOverrides,
173 - $mCookiePassword;
 173+ $mCookiePassword, $mEditCount, $mAllowUsertalk;
174174 //@}
175175
176176 /**
@@ -211,6 +211,10 @@
212212 * @var Block
213213 */
214214 var $mBlock;
 215+
 216+ /**
 217+ * @var Block
 218+ */
215219 private $mBlockedFromCreateAccount = false;
216220
217221 static $idCacheByName = array();
@@ -229,6 +233,9 @@
230234 $this->clearInstanceCache( 'defaults' );
231235 }
232236
 237+ /**
 238+ * @return String
 239+ */
233240 function __toString(){
234241 return $this->getName();
235242 }
@@ -438,7 +445,6 @@
439446
440447 //@}
441448
442 -
443449 /**
444450 * Get the username corresponding to a given user ID
445451 * @param $id Int User ID
@@ -738,6 +744,8 @@
739745 * - 'valid' Valid for batch processes
740746 * - 'usable' Valid for batch processes and login
741747 * - 'creatable' Valid for batch processes, login and account creation
 748+ *
 749+ * @return bool|string
742750 */
743751 public static function getCanonicalName( $name, $validate = 'valid' ) {
744752 # Force usernames to capital
@@ -848,6 +856,8 @@
849857 *
850858 * @note This no longer clears uncached lazy-initialised properties;
851859 * the constructor does that instead.
 860+ *
 861+ * @param $name string
852862 */
853863 private function loadDefaults( $name = false ) {
854864 wfProfileIn( __METHOD__ );
@@ -1159,7 +1169,7 @@
11601170
11611171 /**
11621172 * 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
11641174 * given source. May be "name", "id", "defaults", "session", or false for
11651175 * no reload.
11661176 */
@@ -1349,6 +1359,9 @@
13501360
13511361 /**
13521362 * Check if an IP address is in the local proxy list
 1363+ *
 1364+ * @param $ip string
 1365+ *
13531366 * @return bool
13541367 */
13551368 public static function isLocallyBlockedProxy( $ip ) {
@@ -1882,6 +1895,8 @@
18831896 /**
18841897 * Validate the cache for this account.
18851898 * @param $timestamp String A timestamp in TS_MW format
 1899+ *
 1900+ * @return bool
18861901 */
18871902 public function validateCache( $timestamp ) {
18881903 $this->load();
@@ -1910,6 +1925,8 @@
19111926 *
19121927 * @param $str String New password to set
19131928 * @throws PasswordError on failure
 1929+ *
 1930+ * @return bool
19141931 */
19151932 public function setPassword( $str ) {
19161933 global $wgAuth;
@@ -1974,7 +1991,7 @@
19751992 * Set the random token (used for persistent authentication)
19761993 * Called from loadDefaults() among other places.
19771994 *
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
19791996 */
19801997 public function setToken( $token = false ) {
19811998 global $wgSecretKey, $wgProxyKey;
@@ -2218,6 +2235,8 @@
22192236
22202237 /**
22212238 * Get the user preferred stub threshold
 2239+ *
 2240+ * @return int
22222241 */
22232242 public function getStubThreshold() {
22242243 global $wgMaxArticleSize; # Maximum article size, in Kb
@@ -2409,8 +2428,11 @@
24102429
24112430 /**
24122431 * 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
24142434 * @return Boolean: True if user is allowed to perform *any* of the given actions
 2435+ *
 2436+ * @return bool
24152437 */
24162438 public function isAllowedAny( /*...*/ ){
24172439 $permissions = func_get_args();
@@ -2423,7 +2445,8 @@
24242446 }
24252447
24262448 /**
2427 - * @param varargs String
 2449+ *
 2450+ * @internal param $varargs string
24282451 * @return bool True if the user is allowed to perform *all* of the given actions
24292452 */
24302453 public function isAllowedAll( /*...*/ ){
@@ -2439,7 +2462,7 @@
24402463 /**
24412464 * Internal mechanics of testing a permission
24422465 * @param $action String
2443 - * @paramn $ns int Namespace optional
 2466+ * @param $ns int|null Namespace optional
24442467 * @return bool
24452468 */
24462469 public function isAllowed( $action = '', $ns = null ) {
@@ -3043,6 +3066,9 @@
30443067 /**
30453068 * Check if the given clear-text password matches the temporary password
30463069 * sent by e-mail for password reset operations.
 3070+ *
 3071+ * @param $plaintext string
 3072+ *
30473073 * @return Boolean: True if matches, false otherwise
30483074 */
30493075 public function checkTemporaryPassword( $plaintext ) {
@@ -3197,7 +3223,7 @@
31983224 * @note Call saveSettings() after calling this function to commit
31993225 * this change to the database.
32003226 *
3201 - * @param[out] &$expiration \mixed Accepts the expiration time
 3227+ * @param &$expiration \mixed Accepts the expiration time
32023228 * @return String New token
32033229 */
32043230 private function confirmationToken( &$expiration ) {
@@ -3258,6 +3284,8 @@
32593285 * Mark the e-mail address confirmed.
32603286 *
32613287 * @note Call saveSettings() after calling this function to commit the change.
 3288+ *
 3289+ * @return true
32623290 */
32633291 public function confirmEmail() {
32643292 $this->setEmailAuthenticationTimestamp( wfTimestampNow() );
@@ -3397,6 +3425,8 @@
33983426 * Get the permissions associated with a given list of groups
33993427 *
34003428 * @param $groups Array of Strings List of internal group names
 3429+ * @param $ns int
 3430+ *
34013431 * @return Array of Strings List of permission key names for given groups combined
34023432 */
34033433 public static function getGroupPermissions( $groups, $ns = null ) {
@@ -3423,8 +3453,8 @@
34243454
34253455 /**
34263456 * Helper for User::getGroupPermissions
3427 - * @param array $list
3428 - * @param int $ns
 3457+ * @param $list array
 3458+ * @param $ns int
34293459 * @return array
34303460 */
34313461 private static function extractRights( $list, $ns ) {
@@ -3449,6 +3479,9 @@
34503480 * Get all the groups who have a given permission
34513481 *
34523482 * @param $role String Role to check
 3483+ * @param $ns int
 3484+ *
 3485+ *
34533486 * @return Array of Strings List of internal group names with the given permission
34543487 */
34553488 public static function getGroupsWithPermission( $role, $ns = null ) {
@@ -3768,7 +3801,8 @@
37693802 * Make a new-style password hash
37703803 *
37713804 * @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+
37733807 * If unspecified or false, will generate one automatically
37743808 * @return String Password hash
37753809 */
@@ -3796,8 +3830,9 @@
37973831 *
37983832 * @param $hash String Password hash
37993833 * @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
38023837 */
38033838 public static function comparePasswords( $hash, $password, $userId = false ) {
38043839 $type = substr( $hash, 0, 3 );
@@ -3873,6 +3908,9 @@
38743909 return true;
38753910 }
38763911
 3912+ /**
 3913+ * @todo document
 3914+ */
38773915 protected function loadOptions() {
38783916 $this->load();
38793917 if ( $this->mOptionsLoaded || !$this->getId() )
@@ -3909,6 +3947,9 @@
39103948 wfRunHooks( 'UserLoadOptions', array( $this, &$this->mOptions ) );
39113949 }
39123950
 3951+ /**
 3952+ * @todo document
 3953+ */
39133954 protected function saveOptions() {
39143955 global $wgAllowPrefChange;
39153956
@@ -3923,8 +3964,9 @@
39243965
39253966 // Allow hooks to abort, for instance to save to a global profile.
39263967 // Reset options to default state before saving.
3927 - if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) )
 3968+ if( !wfRunHooks( 'UserSaveOptions', array( $this, &$saveOptions ) ) ) {
39283969 return;
 3970+ }
39293971
39303972 foreach( $saveOptions as $key => $value ) {
39313973 # Don't bother storing default values
Index: trunk/phase3/includes/db/Database.php
@@ -1011,7 +1011,7 @@
10121012 * @param $fname string The function name of the caller.
10131013 * @param $options string|array The query options. See DatabaseBase::select() for details.
10141014 *
1015 - * @return The value from the field, or false on failure.
 1015+ * @return false|mixed The value from the field, or false on failure.
10161016 */
10171017 function selectField( $table, $var, $cond = '', $fname = 'DatabaseBase::selectField',
10181018 $options = array() )
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -236,7 +236,7 @@
237237 $wgHooks['LoadExtensionSchemaUpdates'][] = 'efCodeReviewSchemaUpdates';
238238
239239 /**
240 - * @param $updater DatabaseUpdater
 240+ * @param $updater DatabaseUpdater
241241 * @return bool
242242 */
243243 function efCodeReviewSchemaUpdates( $updater ) {

Status & tagging log