objectcache: improve BagOStuff arithmetic method signatures
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 17 Jul 2019 19:19:05 +0000 (12:19 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 24 Aug 2019 19:50:37 +0000 (12:50 -0700)
commit94eb0c946f249aace839ec3876b6ab11e7fc39b8
treecc822dacbb4bff05cea99f9b52ed833472153de7
parent41355718e137b2ed88160ad5ddb4db50336d54d9
objectcache: improve BagOStuff arithmetic method signatures

Make the default $init value for incrWithInit() be $value.
This is far less suprising and also makes the operation
easier to replicate without conflicts.

Make decr() definitions more explicit since various cache
drivers do not handle negative incr() values (e.g. memcached).

Change-Id: I2b8d642656cc91c841abbd7a55d97eba101b027a
16 files changed:
includes/libs/objectcache/APCBagOStuff.php
includes/libs/objectcache/APCUBagOStuff.php
includes/libs/objectcache/BagOStuff.php
includes/libs/objectcache/CachedBagOStuff.php
includes/libs/objectcache/EmptyBagOStuff.php
includes/libs/objectcache/HashBagOStuff.php
includes/libs/objectcache/MediumSpecificBagOStuff.php
includes/libs/objectcache/MemcachedPeclBagOStuff.php
includes/libs/objectcache/MemcachedPhpBagOStuff.php
includes/libs/objectcache/MultiWriteBagOStuff.php
includes/libs/objectcache/RESTBagOStuff.php
includes/libs/objectcache/RedisBagOStuff.php
includes/libs/objectcache/ReplicatedBagOStuff.php
includes/libs/objectcache/WinCacheBagOStuff.php
includes/objectcache/SqlBagOStuff.php
tests/phpunit/includes/libs/objectcache/BagOStuffTest.php