r98634 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98633‎ | r98634 | r98635 >
Date:22:31, 1 October 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
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 (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/dataclasses/ConfirmAccount.class.php
@@ -15,7 +15,7 @@
1616
1717 $repo = new FSRepo( $wgConfirmAccountFSRepos['accountreqs'] );
1818 # Clear out any associated attachments and delete those rows
19 - while( $row = $dbw->fetchObject( $res ) ) {
 19+ foreach( $res as $row ) {
2020 $key = $row->acr_storage_key;
2121 if( $key ) {
2222 $path = $repo->getZonePath( 'public' ).'/'.
@@ -101,7 +101,7 @@
102102 * @param string $ip User IP address
103103 * @param string $token
104104 * @param string $expiration
105 - * @return mixed True on success, a Status object on failure.
 105+ * @return true|Status True on success, a Status object on failure.
106106 */
107107 public static function sendConfirmationMail( User $user, $ip, $token, $expiration ) {
108108 global $wgContLang;
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/UserCredentials_body.php
@@ -2,6 +2,7 @@
33
44 class UserCredentialsPage extends SpecialPage {
55
 6+ protected $target, $skin, $file;
67 function __construct() {
78 parent::__construct( 'UserCredentials', 'lookupcredentials' );
89 }
@@ -93,7 +94,7 @@
9495
9596 $form .= '</table></fieldset>';
9697
97 - $areaSet = RequestAccountPage::expandAreas( $row->acd_areas );
 98+ $areaSet = RequestAccountPage::expandAreas( $row->acd_areas ); // FIXME: Method is undefined
9899
99100 if ( wfMsg( 'requestaccount-areas' ) ) {
100101 $form .= '<fieldset>';
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/RequestAccount_body.php
@@ -49,7 +49,7 @@
5050 $this->mAreas = $this->mAreaSet = array();
5151 if ( wfMsg( 'requestaccount-areas' ) ) {
5252 $areas = explode( "\n*", "\n" . wfMsg( 'requestaccount-areas' ) );
53 - foreach ( $areas as $n => $area ) {
 53+ foreach ( $areas as $area ) {
5454 $set = explode( "|", $area, 2 );
5555 if ( $set[0] && isset( $set[1] ) ) {
5656 $formName = "wpArea-" . htmlspecialchars( str_replace( ' ', '_', $set[0] ) );
@@ -115,6 +115,7 @@
116116 $form .= "<td>" . Xml::input( 'wpEmail', 30, $this->mEmail, array( 'id' => 'wpEmail' ) ) . "</td></tr>\n";
117117 if ( count( $wgAccountRequestTypes ) > 1 ) {
118118 $form .= "<tr><td>" . wfMsgHtml( 'requestaccount-reqtype' ) . "</td><td>";
 119+ $options = array();
119120 foreach ( $wgAccountRequestTypes as $i => $params ) {
120121 $options[] = Xml::option( wfMsg( "requestaccount-level-$i" ), $i, ( $i == $this->mType ) );
121122 }
@@ -314,7 +315,7 @@
315316 $reqUser = $this->getUser();
316317 $out = $this->getOutput();
317318 # Confirm if this token is in the pending requests
318 - $name = ConfirmAccount::requestNameFromEmailToken( $code );
 319+ $name = ConfirmAccount::requestNameFromEmailToken( $code ); // FIXME: This method isn't static
319320 if ( $name !== false ) {
320321 # Send confirmation email to prospective user
321322 ConfirmAccount::confirmEmail( $name );
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php
@@ -670,7 +670,7 @@
671671 # Add any interest categories
672672 if( wfMsgForContent( 'requestaccount-areas' ) ) {
673673 $areas = explode("\n*","\n".wfMsg('requestaccount-areas'));
674 - foreach( $areas as $n => $line ) {
 674+ foreach( $areas as $line ) {
675675 $set = explode("|",$line);
676676 //$name = str_replace("_"," ",$set[0]);
677677 if( in_array($set[0],$this->reqAreaSet) ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r98640Followup r98634 make method static, remove comment...reedy23:03, 1 October 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   22:54, 1 October 2011

Everything in ConfirmAccount should be static.

Status & tagging log