Merge "Fix MessagecacheTest::testLoadFromDB_fetchLatestRevision"
[lhc/web/wiklou.git] / includes / libs / MemoizedCallable.php
index 90c7a64..e9d1fc1 100644 (file)
@@ -75,6 +75,7 @@ class MemoizedCallable {
         *
         * @param string $key
         * @param bool &$success
+        * @return bool
         */
        protected function fetchResult( $key, &$success ) {
                $success = false;
@@ -122,7 +123,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 );
                }
 
@@ -148,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 );