r77296 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77295‎ | r77296 | r77297 >
Date:19:47, 25 November 2010
Author:hashar
Status:resolved (Comments)
Tags:
Comment:
consistent incr() return value in case of error. follow up 74579
Modified paths:
  • /trunk/phase3/includes/BagOStuff.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/BagOStuff.php
@@ -130,9 +130,12 @@
131131 }
132132 }
133133
 134+ /**
 135+ * @return null if lock is not possible. New value incremented by 1
 136+ */
134137 public function incr( $key, $value = 1 ) {
135138 if ( !$this->lock( $key ) ) {
136 - return false;
 139+ return null;
137140 }
138141
139142 $value = intval( $value );

Follow-up revisions

RevisionCommit summaryAuthorDate
r77320doc comments: fix grammar and return parameter. fu r77296hashar07:45, 26 November 2010

Comments

#Comment by Nikerabbit (talk | contribs)   07:19, 26 November 2010

See my rant about the useage of increment/decrement as a verb in r76545. Plus it's increased by the amount of $value, which only defaults to 1.

Status & tagging log