Merge "FauxRequest: don’t override getValues()"
[lhc/web/wiklou.git] / includes / libs / MemoizedCallable.php
index 14462f1..f511229 100644 (file)
@@ -48,6 +48,9 @@ class MemoizedCallable {
        /** @var string Unique name of callable; used for cache keys. */
        private $callableName;
 
+       /** @var int */
+       private $ttl;
+
        /**
         * @throws InvalidArgumentException if $callable is not a callable.
         * @param callable $callable Function or method to memoize.
@@ -123,7 +126,7 @@ class MemoizedCallable {
                $success = false;
                $result = $this->fetchResult( $key, $success );
                if ( !$success ) {
-                       $result = call_user_func_array( $this->callable, $args );
+                       $result = ( $this->callable )( ...$args );
                        $this->storeResult( $key, $result );
                }
 
@@ -135,11 +138,11 @@ 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() {
-               return $this->invokeArgs( func_get_args() );
+       public function invoke( ...$params ) {
+               return $this->invokeArgs( $params );
        }
 
        /**