1 | <?php |
||
7 | class ArrayUtil |
||
8 | { |
||
9 | /** |
||
10 | * Merges arrays recursively while preserving. |
||
11 | * |
||
12 | * @param array $array1 |
||
13 | * @param array $array2 |
||
14 | * |
||
15 | * @return array |
||
16 | * |
||
17 | * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 |
||
18 | * @see https://github.com/grasmash/bolt/blob/robo-rebase/src/Robo/Common/ArrayManipulator.php#L22 |
||
19 | */ |
||
20 | public static function mergeRecursiveDistinct( |
||
30 | |||
31 | /** |
||
32 | * Process the value in an mergeRecursiveDistinct - make a recursive |
||
33 | * call if needed. |
||
34 | */ |
||
35 | protected static function mergeRecursiveValue(&$merged, $key, $value) |
||
42 | |||
43 | |||
44 | /** |
||
45 | * Merges arrays recursively while preserving. |
||
46 | * |
||
47 | * @param array $array1 |
||
48 | * @param array $array2 |
||
49 | * |
||
50 | * @return array |
||
51 | * |
||
52 | * @see http://php.net/manual/en/function.array-merge-recursive.php#92195 |
||
53 | * @see https://github.com/grasmash/bolt/blob/robo-rebase/src/Robo/Common/ArrayManipulator.php#L22 |
||
54 | */ |
||
55 | public static function mergeRecursiveSelect( |
||
67 | |||
68 | /** |
||
69 | * Process the value in an mergeRecursiveDistinct - make a recursive |
||
70 | * call if needed. |
||
71 | */ |
||
72 | protected static function mergeRecursiveSelectValue(&$merged, $key, $value, $selectionList, $keyPrefix) |
||
83 | |||
84 | protected static function selectMerge($keyPrefix, $key, $selectionList) |
||
88 | |||
89 | |||
90 | /** |
||
91 | * Fills all of the leaf-node values of a nested array with the |
||
92 | * provided replacement value. |
||
93 | */ |
||
94 | public static function fillRecursive(array $data, $fill) |
||
105 | |||
106 | /** |
||
107 | * Return true if the provided parameter is an array, and at least |
||
108 | * one key is non-numeric. |
||
109 | */ |
||
110 | public static function isAssociative($testArray) |
||
122 | } |
||
123 |