r98539 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98538‎ | r98539 | r98540 >
Date:17:31, 30 September 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
Made addNewUserLogEntry() return the ID of the new log entry to be more useful
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -3913,7 +3913,7 @@
39143914 * @param $byEmail Boolean: account made by email?
39153915 * @param $reason String: user supplied reason
39163916 *
3917 - * @return true
 3917+ * @return int|bool True if not $wgNewUserLog; otherwise ID of log item or 0 on failure
39183918 */
39193919 public function addNewUserLogEntry( $byEmail = false, $reason = '' ) {
39203920 global $wgUser, $wgContLang, $wgNewUserLog;
@@ -3935,13 +3935,12 @@
39363936 }
39373937 }
39383938 $log = new LogPage( 'newusers' );
3939 - $log->addEntry(
 3939+ return (int)$log->addEntry(
39403940 $action,
39413941 $this->getUserPage(),
39423942 $reason,
39433943 array( $this->getId() )
39443944 );
3945 - return true;
39463945 }
39473946
39483947 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r106420r98539 - make a note of change in commentsnikerabbit09:22, 16 December 2011

Comments

#Comment by Nikerabbit (talk | contribs)   05:58, 1 October 2011

The change in function signature in this version should be stated clearly.

#Comment by Aaron Schulz (talk | contribs)   06:02, 1 October 2011

Like "Before 1.19 this only returned a boolean" or such? Do we have a standard way of wording these things?

#Comment by Nikerabbit (talk | contribs)   06:07, 1 October 2011

I don't think we have any established practice on that.

Status & tagging log