X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FArrayUtils.php;h=ccc76bb77ba45697b966455afbd088ee69e51ff6;hb=31f646e2f502ff66bbdf96c20c4770466c56d221;hp=0413ea0d5a2d78dcd5e3fee28df6b313ac2de767;hpb=967a96e7fa5910f8fc451590decb381dbfb481ba;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/ArrayUtils.php b/includes/libs/ArrayUtils.php index 0413ea0d5a..ccc76bb77b 100644 --- a/includes/libs/ArrayUtils.php +++ b/includes/libs/ArrayUtils.php @@ -120,8 +120,8 @@ class ArrayUtils { $max = $valueCount; do { $mid = $min + ( ( $max - $min ) >> 1 ); - $item = call_user_func( $valueCallback, $mid ); - $comparison = call_user_func( $comparisonCallback, $target, $item ); + $item = $valueCallback( $mid ); + $comparison = $comparisonCallback( $target, $item ); if ( $comparison > 0 ) { $min = $mid; } elseif ( $comparison == 0 ) { @@ -133,8 +133,8 @@ class ArrayUtils { } while ( $min < $max - 1 ); if ( $min == 0 ) { - $item = call_user_func( $valueCallback, $min ); - $comparison = call_user_func( $comparisonCallback, $target, $item ); + $item = $valueCallback( $min ); + $comparison = $comparisonCallback( $target, $item ); if ( $comparison < 0 ) { // Before the first item return false; @@ -151,13 +151,11 @@ class ArrayUtils { * @since 1.23 * * @param array $array1 The array to compare from - * @param array $array2,... More arrays to compare against + * @param array ...$arrays More arrays to compare against * @return array An array containing all the values from array1 * that are not present in any of the other arrays. */ - public static function arrayDiffAssocRecursive( $array1 ) { - $arrays = func_get_args(); - array_shift( $arrays ); + public static function arrayDiffAssocRecursive( $array1, ...$arrays ) { $ret = []; foreach ( $array1 as $key => $value ) { @@ -168,7 +166,7 @@ class ArrayUtils { $args[] = $array[$key]; } } - $valueret = call_user_func_array( __METHOD__, $args ); + $valueret = self::arrayDiffAssocRecursive( ...$args ); if ( count( $valueret ) ) { $ret[$key] = $valueret; }