http://www.mediawiki.org/wiki/Special:Code/MediaWiki/98634
Revision: 98634 Author: reedy Date: 2011-10-01 22:31:19 +0000 (Sat, 01 Oct 2011) Log Message: ----------- Add some documentation/explicit variables Add a couple of FIXME's (non static method called statically, undefined function) Remove unused variables Improve assignment in conditional Modified Paths: -------------- trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php Modified: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php =================================================================== --- trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php 2011-10-01 22:18:54 UTC (rev 98633) +++ trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php 2011-10-01 22:31:19 UTC (rev 98634) @@ -15,7 +15,7 @@ $repo = new FSRepo( $wgConfirmAccountFSRepos['accountreqs'] ); # Clear out any associated attachments and delete those rows - while( $row = $dbw->fetchObject( $res ) ) { + foreach( $res as $row ) { $key = $row->acr_storage_key; if( $key ) { $path = $repo->getZonePath( 'public' ).'/'. @@ -101,7 +101,7 @@ * @param string $ip User IP address * @param string $token * @param string $expiration - * @return mixed True on success, a Status object on failure. + * @return true|Status True on success, a Status object on failure. */ public static function sendConfirmationMail( User $user, $ip, $token, $expiration ) { global $wgContLang; Modified: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php 2011-10-01 22:18:54 UTC (rev 98633) +++ trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php 2011-10-01 22:31:19 UTC (rev 98634) @@ -670,7 +670,7 @@ # Add any interest categories if( wfMsgForContent( 'requestaccount-areas' ) ) { $areas = explode("\n*","\n".wfMsg('requestaccount-areas')); - foreach( $areas as $n => $line ) { + foreach( $areas as $line ) { $set = explode("|",$line); //$name = str_replace("_"," ",$set[0]); if( in_array($set[0],$this->reqAreaSet) ) { Modified: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php 2011-10-01 22:18:54 UTC (rev 98633) +++ trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php 2011-10-01 22:31:19 UTC (rev 98634) @@ -49,7 +49,7 @@ $this->mAreas = $this->mAreaSet = array(); if ( wfMsg( 'requestaccount-areas' ) ) { $areas = explode( "\n*", "\n" . wfMsg( 'requestaccount-areas' ) ); - foreach ( $areas as $n => $area ) { + foreach ( $areas as $area ) { $set = explode( "|", $area, 2 ); if ( $set[0] && isset( $set[1] ) ) { $formName = "wpArea-" . htmlspecialchars( str_replace( ' ', '_', $set[0] ) ); @@ -115,6 +115,7 @@ $form .= "<td>" . Xml::input( 'wpEmail', 30, $this->mEmail, array( 'id' => 'wpEmail' ) ) . "</td></tr>\n"; if ( count( $wgAccountRequestTypes ) > 1 ) { $form .= "<tr><td>" . wfMsgHtml( 'requestaccount-reqtype' ) . "</td><td>"; + $options = array(); foreach ( $wgAccountRequestTypes as $i => $params ) { $options[] = Xml::option( wfMsg( "requestaccount-level-$i" ), $i, ( $i == $this->mType ) ); } @@ -314,7 +315,7 @@ $reqUser = $this->getUser(); $out = $this->getOutput(); # Confirm if this token is in the pending requests - $name = ConfirmAccount::requestNameFromEmailToken( $code ); + $name = ConfirmAccount::requestNameFromEmailToken( $code ); // FIXME: This method isn't static if ( $name !== false ) { # Send confirmation email to prospective user ConfirmAccount::confirmEmail( $name ); Modified: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php =================================================================== --- trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php 2011-10-01 22:18:54 UTC (rev 98633) +++ trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php 2011-10-01 22:31:19 UTC (rev 98634) @@ -2,6 +2,7 @@ class UserCredentialsPage extends SpecialPage { + protected $target, $skin, $file; function __construct() { parent::__construct( 'UserCredentials', 'lookupcredentials' ); } @@ -93,7 +94,7 @@ $form .= '</table></fieldset>'; - $areaSet = RequestAccountPage::expandAreas( $row->acd_areas ); + $areaSet = RequestAccountPage::expandAreas( $row->acd_areas ); // FIXME: Method is undefined if ( wfMsg( 'requestaccount-areas' ) ) { $form .= '<fieldset>'; _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs