src/Phinx/Config/Config.php
protected function recurseArrayForTokens($arr, $tokens)
    {
        $out = [];
        foreach ($arr as $name => $value) {
            if (is_array($value)) {
                $out[$name] = $this->recurseArrayForTokens($value, $tokens);
                continue;
            }
            if (is_string($value)) {
                foreach ($tokens as $token => $tval) {
                    $value = str_replace($token, $tval, $value);
                }
                $out[$name] = $value;
                continue;
            }
            $out[$name] = $value;
        }

        return $out;
    }
protected function recurseArrayForTokens($arr, $tokens)
    {
        $out = [];
        foreach ($arr as $name => $value) {
            if (is_array($value)) {
                $out[$name] = $this->recurseArrayForTokens($value, $tokens);
                continue;
            }
            if (is_string($value)) {
                foreach ($tokens as $token => $tval) {
                    $value = str_replace($token, $tval, $value);
                }
                $out[$name] = $value;
                continue;
            }
            $out[$name] = $value;
        }

        return $out;
    }
protected function recurseArrayForTokens ( $ arr , $ tokens ) { $ out = [ ] ; foreach ( $ arr as $ name => $ value ) { if ( is_array ( $ value ) ) { $ out [ $ name ] = $ this -> recurseArrayForTokens ( $ value , $ tokens ) ; continue ; } if ( is_string ( $ value ) ) { foreach ( $ tokens as $ token => $ tval ) { $ value = str_replace ( $ token , $ tval , $ value ) ; } $ out [ $ name ] = $ value ; continue ; } $ out [ $ name ] = $ value ; } return $ out ; }
Recurse an array for the specified tokens and replace them.

@param array $arr Array to recurse
@param array $tokens Array of tokens to search for
@return array
Recurse an array for the specified tokens and replace them .