From: Kunal Mehta Date: Sat, 28 May 2016 02:30:14 +0000 (-0700) Subject: WatchedItemStore: Use callable type hint instead of Assert library X-Git-Tag: 1.31.0-rc.0~6774^2 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=ce251d15b7ccbaee4720ea2d162f34382d2011e6;p=lhc%2Fweb%2Fwiklou.git WatchedItemStore: Use callable type hint instead of Assert library And remove an unused use statement. Change-Id: Idb74a564088744d73f71f5ef17e8f84f6e484c69 --- diff --git a/includes/WatchedItemStore.php b/includes/WatchedItemStore.php index 6486955fc4..515fbfce86 100644 --- a/includes/WatchedItemStore.php +++ b/includes/WatchedItemStore.php @@ -1,7 +1,6 @@ deferredUpdatesAddCallableUpdateCallback; $this->deferredUpdatesAddCallableUpdateCallback = $callback; return new ScopedCallback( function() use ( $previousValue ) { @@ -106,14 +103,12 @@ class WatchedItemStore implements StatsdAwareInterface { * @return ScopedCallback to reset the overridden value * @throws MWException */ - public function overrideRevisionGetTimestampFromIdCallback( $callback ) { + public function overrideRevisionGetTimestampFromIdCallback( callable $callback ) { if ( !defined( 'MW_PHPUNIT_TEST' ) ) { throw new MWException( 'Cannot override Revision::getTimestampFromId callback in operation.' ); } - Assert::parameterType( 'callable', $callback, '$callback' ); - $previousValue = $this->revisionGetTimestampFromIdCallback; $this->revisionGetTimestampFromIdCallback = $callback; return new ScopedCallback( function() use ( $previousValue ) {