protected function swapKeys(array $aliases, array $map)
    {
        return array_map(function ($alias) use ($map) {
            foreach ($map as $from => $to) {
                if (isset($alias[$from])) {
                    $alias[$to] = $alias[$from];
                    unset($alias[$from]);
                }
            }

            return $alias;
        }, $aliases);
    }
protected function swapKeys(array $aliases, array $map)
    {
        return array_map(function ($alias) use ($map) {
            foreach ($map as $from => $to) {
                if (isset($alias[$from])) {
                    $alias[$to] = $alias[$from];
                    unset($alias[$from]);
                }
            }

            return $alias;
        }, $aliases);
    }
protected function swapKeys ( array $ aliases , array $ map ) { return array_map ( function ( $ alias ) use ( $ map ) { foreach ( $ map as $ from => $ to ) { if ( isset ( $ alias [ $ from ] ) ) { $ alias [ $ to ] = $ alias [ $ from ] ; unset ( $ alias [ $ from ] ) ; } } return $ alias ; } , $ aliases ) ; }
Swap the key names in an array of aliases.

@param array $aliases
@param array $map

@return array
Swap the key names in an array of aliases .