Change-Id: I6ecb609c88e4fc1ef614e94c551199bd610ca360
*/
public function incrWithInit( $key, $ttl, $value = 1, $init = 1 ) {
return $this->incr( $key, $value ) ||
- $this->add( $key, $init, $ttl ) || $this->incr( $key, $value );
+ $this->add( $key, (int)$init, $ttl ) || $this->incr( $key, $value );
}
/**
if ( $cache ) {
$counter = $cache->incr( $bucket, $count );
if ( $counter === false ) {
- if ( !$cache->add( $bucket, $count ) ) {
+ if ( !$cache->add( $bucket, (int)$count ) ) {
throw new MWException( 'Unable to set value to ' . get_class( $cache ) );
}
$counter = $count;