X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Flibs%2Fobjectcache%2FHashBagOStuff.php;h=6d583da07c097f40f3653fbaa21dbdb0c034077c;hp=e03cec6a2f3fa56ebf61b372cfc071ff26054725;hb=d455aa29a685971c8191bc38383f1514e7cae806;hpb=734ca2b4d2a1246fb0ea1e54b861ab423ab5e257 diff --git a/includes/libs/objectcache/HashBagOStuff.php b/includes/libs/objectcache/HashBagOStuff.php index e03cec6a2f..6d583da07c 100644 --- a/includes/libs/objectcache/HashBagOStuff.php +++ b/includes/libs/objectcache/HashBagOStuff.php @@ -20,7 +20,6 @@ * @file * @ingroup Cache */ -use Wikimedia\Assert\Assert; /** * Simple store for keeping values in an associative array for the current process. @@ -32,7 +31,7 @@ use Wikimedia\Assert\Assert; class HashBagOStuff extends BagOStuff { /** @var mixed[] */ protected $bag = []; - /** @var integer Max entries allowed */ + /** @var int Max entries allowed */ protected $maxCacheKeys; const KEY_VAL = 0; @@ -46,7 +45,9 @@ class HashBagOStuff extends BagOStuff { 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 ) {