src/BsbDoctrineTranslationLoader/Util/ConfigManipulate.php
final protected static function replaceKey($data, $search, $replace)
    {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $data[$key] = $value = self::replaceKey($data[$key], $search, $replace);
            }
            if ($key == $search) {
                $data[$replace] = $value;
                unset($data[$search]);
            }
        }

        return $data;
    }
final protected static function replaceKey($data, $search, $replace)
    {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $data[$key] = $value = self::replaceKey($data[$key], $search, $replace);
            }
            if ($key == $search) {
                $data[$replace] = $value;
                unset($data[$search]);
            }
        }

        return $data;
    }
final protected static function replaceKey ( $ data , $ search , $ replace ) { foreach ( $ data as $ key => $ value ) { if ( is_array ( $ value ) ) { $ data [ $ key ] = $ value = self :: replaceKey ( $ data [ $ key ] , $ search , $ replace ) ; } if ( $ key == $ search ) { $ data [ $ replace ] = $ value ; unset ( $ data [ $ search ] ) ; } } return $ data ; }
Recursively replace keys of associative arrays

@param array $data
@param string $search
@param string $replace
@return array
Recursively replace keys of associative arrays