X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FMemoizedCallable.php;h=e9d1fc1ca3e15b6c56f194be8776d9aceeffba03;hb=5e2d030675f6ffaf3391e0483d10d6c4477a9231;hp=12a5cadb993f22354dd6e458654d699c52aaff96;hpb=7874fc4bec845ad92960b07e969c65f3c3fe74f2;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/MemoizedCallable.php b/includes/libs/MemoizedCallable.php index 12a5cadb99..e9d1fc1ca3 100644 --- a/includes/libs/MemoizedCallable.php +++ b/includes/libs/MemoizedCallable.php @@ -1,4 +1,24 @@ fetchResult( $key, $success ); if ( !$success ) { - $result = call_user_func_array( $this->callable, $args ); + $result = ( $this->callable )( ...$args ); $this->storeResult( $key, $result ); } @@ -133,7 +135,7 @@ class MemoizedCallable { * * Like MemoizedCallable::invokeArgs(), but variadic. * - * @param mixed ...$params Parameters for memoized function or method. + * @param mixed $params,... Parameters for memoized function or method. * @return mixed The memoized callable's return value. */ public function invoke() { @@ -147,6 +149,7 @@ class MemoizedCallable { * @param callable $callable * @param array $args * @param int $ttl + * @return mixed */ public static function call( $callable, array $args = [], $ttl = 3600 ) { $instance = new self( $callable, $ttl );