jenkins-bot has submitted this change and it was merged. Change subject: Avoid Wikimedia\Assert in HashBagOStuff ......................................................................
Avoid Wikimedia\Assert in HashBagOStuff This is the only usage of wikimedia/assert in the planned objectcache library, so it doesn't make much sense to have a dependency upon the entire library just for one usage that is trivially replaced. Change-Id: I8f967fb2b861852c7fc74f7d42e2cbab1df05bc4 --- M includes/libs/objectcache/HashBagOStuff.php 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/includes/libs/objectcache/HashBagOStuff.php b/includes/libs/objectcache/HashBagOStuff.php index e03cec6..baa3c32 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. @@ -46,7 +45,9 @@ 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 ) { -- To view, visit https://gerrit.wikimedia.org/r/311921 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8f967fb2b861852c7fc74f7d42e2cbab1df05bc4 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Legoktm <legoktm.wikipe...@gmail.com> Gerrit-Reviewer: Aaron Schulz <asch...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits