1 | <?php |
||
7 | final class ArrayHelper extends HelperAbstract |
||
8 | { |
||
9 | /** |
||
10 | * Renames the given data array keys for the corresponding values in $mapper. |
||
11 | * If $mapper does not have the key, the name is preserved. |
||
12 | * |
||
13 | * @param array $mapper [from => to] |
||
14 | */ |
||
15 | 1 | public static function renameKeys(array $data, array $mapper): array |
|
26 | |||
27 | /** |
||
28 | * Fetch array data in dot notation path |
||
29 | * |
||
30 | * @return mixed|null |
||
31 | */ |
||
32 | 4 | public static function extract(array $data, string $path) |
|
50 | |||
51 | 4 | public static function isTwoDimensional(array $array): bool |
|
56 | |||
57 | /** |
||
58 | * Same as array_map, but recursive |
||
59 | */ |
||
60 | 2 | public static function mapRecursive(callable $func, array $array) |
|
64 | } |
||
65 |