src/Transformer/Transformer.php
protected function recursiveSetKeysToUnderScore(array &$array)
    {
        $newArray = [];
        foreach ($array as $key => &$value) {
            $underscoreKey = RecursiveFormatterHelper::camelCaseToUnderscore($key);
            $newArray[$underscoreKey] = $value;

            if (\is_array($value)) {
                $this->recursiveSetKeysToUnderScore($newArray[$underscoreKey]);
            }
        }
        $array = $newArray;
    }
protected function recursiveSetKeysToUnderScore(array &$array)
    {
        $newArray = [];
        foreach ($array as $key => &$value) {
            $underscoreKey = RecursiveFormatterHelper::camelCaseToUnderscore($key);
            $newArray[$underscoreKey] = $value;

            if (\is_array($value)) {
                $this->recursiveSetKeysToUnderScore($newArray[$underscoreKey]);
            }
        }
        $array = $newArray;
    }
protected function recursiveSetKeysToUnderScore ( array & $ array ) { $ newArray = [ ] ; foreach ( $ array as $ key => & $ value ) { $ underscoreKey = RecursiveFormatterHelper :: camelCaseToUnderscore ( $ key ) ; $ newArray [ $ underscoreKey ] = $ value ; if ( \ is_array ( $ value ) ) { $ this -> recursiveSetKeysToUnderScore ( $ newArray [ $ underscoreKey ] ) ; } } $ array = $ newArray ; }
Changes all array keys to under_score format using recursion.

@param array $array
Changes all array keys to under_score format using recursion .