Make sure to not unpack an associative array into parameter list
[lhc/web/wiklou.git] / includes / cache / CacheHelper.php
index 8c70be2..6c6b184 100644 (file)
@@ -18,7 +18,7 @@
  * http://www.gnu.org/copyleft/gpl.html
  *
  * @file
- * @license GNU GPL v2 or later
+ * @license GPL-2.0-or-later
  * @author Jeroen De Dauw < jeroendedauw@gmail.com >
  */
 
@@ -273,7 +273,7 @@ class CacheHelper implements ICacheHelper {
                                $itemKey = array_keys( array_slice( $this->cachedChunks, 0, 1 ) );
                                $itemKey = array_shift( $itemKey );
 
-                               if ( !is_integer( $itemKey ) ) {
+                               if ( !is_int( $itemKey ) ) {
                                        wfWarn( "Attempted to get item with non-numeric key while " .
                                                "the next item in the queue has a key ($itemKey) in " . __METHOD__ );
                                } elseif ( is_null( $itemKey ) ) {
@@ -294,7 +294,7 @@ class CacheHelper implements ICacheHelper {
                                $args = [ $args ];
                        }
 
-                       $value = call_user_func_array( $computeFunction, $args );
+                       $value = $computeFunction( ...$args );
 
                        if ( $this->cacheEnabled ) {
                                if ( is_null( $key ) ) {
@@ -350,7 +350,7 @@ class CacheHelper implements ICacheHelper {
                        throw new MWException( 'No cache key set, so cannot obtain or save the CacheHelper values.' );
                }
 
-               return call_user_func_array( 'wfMemcKey', $this->cacheKey );
+               return wfMemcKey( ...array_values( $this->cacheKey ) );
        }
 
        /**