/**
* $params include:
* - caches: A numbered array of either ObjectFactory::getObjectFromSpec
- * arrays yeilding BagOStuff objects or direct BagOStuff objects.
+ * arrays yielding BagOStuff objects or direct BagOStuff objects.
* If using the former, the 'args' field *must* be set.
* The first cache is the primary one, being the first to
* be read in the fallback chain. Writes happen to all stores
* invalidation uses logical TTLs, invalidation uses etag/timestamp
* validation against the DB, or merge() is used to handle races.
* @param array $params
+ * @phan-param array{caches:array<int,array|BagOStuff>,replication:string} $params
* @throws InvalidArgumentException
*/
public function __construct( $params ) {
$missIndexes[] = $i;
}
- if ( $value !== false
- && $missIndexes
- && $this->fieldHasFlags( $flags, self::READ_VERIFIED )
+ if (
+ $value !== false &&
+ $this->fieldHasFlags( $flags, self::READ_VERIFIED ) &&
+ $missIndexes
) {
// Backfill the value to the higher (and often faster/smaller) cache tiers
$this->doWrite(
);
}
- public function incr( $key, $value = 1 ) {
+ public function incr( $key, $value = 1, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
$this->asyncWrites,
);
}
- public function decr( $key, $value = 1 ) {
+ public function decr( $key, $value = 1, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
$this->asyncWrites,
);
}
- public function incrWithInit( $key, $ttl, $value = 1, $init = 1 ) {
+ public function incrWithInit( $key, $exptime, $value = 1, $init = null, $flags = 0 ) {
return $this->doWrite(
$this->cacheIndexes,
$this->asyncWrites,