original_string: protected function _sortRootElements(Zend_Config $config)
      {
          $configArray = $config->toArray();
          $sections = array();
  
          // remove sections from config array
          foreach ($configArray as $key => $value) {
              if (is_array($value)) {
                  $sections[$key] = $value;
                  unset($configArray[$key]);
              }
          }
  
          // readd sections to the end
          foreach ($sections as $key => $value) {
              $configArray[$key] = $value;
          }
  
          return new Zend_Config($configArray);
      }
code: protected function _sortRootElements(Zend_Config $config)
      {
          $configArray = $config->toArray();
          $sections = array();
  
          // remove sections from config array
          foreach ($configArray as $key => $value) {
              if (is_array($value)) {
                  $sections[$key] = $value;
                  unset($configArray[$key]);
              }
          }
  
          // readd sections to the end
          foreach ($sections as $key => $value) {
              $configArray[$key] = $value;
          }
  
          return new Zend_Config($configArray);
      }
code_tokens: protected function _sortRootElements ( Zend_Config $ config ) { $ configArray = $ config -> toArray ( ) ; $ sections = array ( ) ; // remove sections from config array foreach ( $ configArray as $ key => $ value ) { if ( is_array ( $ value ) ) { $ sections [ $ key ] = $ value ; unset ( $ configArray [ $ key ] ) ; } } // readd sections to the end foreach ( $ sections as $ key => $ value ) { $ configArray [ $ key ] = $ value ; } return new Zend_Config ( $ configArray ) ; }
docstring: Root elements that are not assigned to any section needs to be
  on the top of config.
  
  @see    http://framework.zend.com/issues/browse/ZF-6289
  @param  Zend_Config
  @return Zend_Config
docstring_tokens: Root elements that are not assigned to any section needs to be on the top of config .