consistent incr() return value in case of error. follow up 74579
authorAntoine Musso <hashar@users.mediawiki.org>
Thu, 25 Nov 2010 19:47:24 +0000 (19:47 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Thu, 25 Nov 2010 19:47:24 +0000 (19:47 +0000)
includes/BagOStuff.php

index 04900f4..5ef9472 100644 (file)
@@ -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 );