* @file
* @ingroup Cache
*/
-use Wikimedia\Assert\Assert;
/**
* Simple store for keeping values in an associative array for the current process.
class HashBagOStuff extends BagOStuff {
/** @var mixed[] */
protected $bag = [];
- /** @var integer Max entries allowed */
+ /** @var int Max entries allowed */
protected $maxCacheKeys;
const KEY_VAL = 0;
parent::__construct( $params );
$this->maxCacheKeys = isset( $params['maxKeys'] ) ? $params['maxKeys'] : INF;
- Assert::parameter( $this->maxCacheKeys > 0, 'maxKeys', 'must be above zero' );
+ if ( $this->maxCacheKeys <= 0 ) {
+ throw new InvalidArgumentException( '$maxKeys parameter must be above zero' );
+ }
}
protected function expire( $key ) {