original_string: public function merge(array $newConfig, array &$config)
      {
          foreach ($newConfig as $routeName => $routeInfo) {
              if (!isset($config[$routeName])) {
                  $config[$routeName] = $this->newRoute($routeName, $routeInfo);
              }
  
              if (isset($routeInfo['child_routes'])) {
                  if (!isset($config[$routeName]['child_routes'])) {
                      $config[$routeName]['child_routes'] = array();
                  }
  
                  $this->merge($routeInfo['child_routes'], $config[$routeName]['child_routes']);
              }
          }
      }
code: public function merge(array $newConfig, array &$config)
      {
          foreach ($newConfig as $routeName => $routeInfo) {
              if (!isset($config[$routeName])) {
                  $config[$routeName] = $this->newRoute($routeName, $routeInfo);
              }
  
              if (isset($routeInfo['child_routes'])) {
                  if (!isset($config[$routeName]['child_routes'])) {
                      $config[$routeName]['child_routes'] = array();
                  }
  
                  $this->merge($routeInfo['child_routes'], $config[$routeName]['child_routes']);
              }
          }
      }
code_tokens: public function merge ( array $ newConfig , array & $ config ) { foreach ( $ newConfig as $ routeName => $ routeInfo ) { if ( ! isset ( $ config [ $ routeName ] ) ) { $ config [ $ routeName ] = $ this -> newRoute ( $ routeName , $ routeInfo ) ; } if ( isset ( $ routeInfo [ 'child_routes' ] ) ) { if ( ! isset ( $ config [ $ routeName ] [ 'child_routes' ] ) ) { $ config [ $ routeName ] [ 'child_routes' ] = array ( ) ; } $ this -> merge ( $ routeInfo [ 'child_routes' ] , $ config [ $ routeName ] [ 'child_routes' ] ) ; } } }
docstring: Recursively update the route stack.
  
  @todo Convert recursion to iteration
  @param  array $newConfig
  @param  array $config
  @return RouteInterface
docstring_tokens: Recursively update the route stack .