X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Flibs%2FArrayUtils.php;h=2156bd7f1dd5b1f137c5a4408bee8fed8d3b0471;hb=be656c67a2dde9924e8558563162616ab3ab88dc;hp=f93402108ade01835fdba88e7a5b0b559862ad88;hpb=cad7a1125dc910b8ee19c8f675099ed65c0a6018;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/libs/ArrayUtils.php b/includes/libs/ArrayUtils.php index f93402108a..2156bd7f1d 100644 --- a/includes/libs/ArrayUtils.php +++ b/includes/libs/ArrayUtils.php @@ -28,7 +28,7 @@ class ArrayUtils { /** * Sort the given array in a pseudo-random order which depends only on the - * given key and each element value. This is typically used for load + * given key and each element value in $array. This is typically used for load * balancing between servers each with a local cache. * * Keys are preserved. The input array is modified in place. @@ -47,7 +47,7 @@ class ArrayUtils { * function was introduced. */ public static function consistentHashSort( &$array, $key, $separator = "\000" ) { - $hashes = array(); + $hashes = []; foreach ( $array as $elt ) { $hashes[$elt] = md5( $elt . $separator . $key ); } @@ -158,11 +158,11 @@ class ArrayUtils { public static function arrayDiffAssocRecursive( $array1 ) { $arrays = func_get_args(); array_shift( $arrays ); - $ret = array(); + $ret = []; foreach ( $array1 as $key => $value ) { if ( is_array( $value ) ) { - $args = array( $value ); + $args = [ $value ]; foreach ( $arrays as $array ) { if ( isset( $array[$key] ) ) { $args[] = $array[$key];