Merge "Add some casts for sanity before BagOStuff::add() calls"
This commit is contained in:
commit
af0f12c254
2 changed files with 2 additions and 2 deletions
|
|
@ -338,7 +338,7 @@ abstract class BagOStuff {
|
|||
*/
|
||||
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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ class UIDGenerator {
|
|||
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue