From: Antoine Musso Date: Thu, 25 Nov 2010 19:47:24 +0000 (+0000) Subject: consistent incr() return value in case of error. follow up 74579 X-Git-Tag: 1.31.0-rc.0~33735 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=ea8b41e57dec09146167c33ae7ac60a304e11127;p=lhc%2Fweb%2Fwiklou.git consistent incr() return value in case of error. follow up 74579 --- diff --git a/includes/BagOStuff.php b/includes/BagOStuff.php index 04900f4981..5ef9472f6f 100644 --- a/includes/BagOStuff.php +++ b/includes/BagOStuff.php @@ -130,9 +130,12 @@ abstract class BagOStuff { } } + /** + * @return null if lock is not possible. New value incremented by 1 + */ public function incr( $key, $value = 1 ) { if ( !$this->lock( $key ) ) { - return false; + return null; } $value = intval( $value );