original_string: protected function generateNamespaceTree($namespaces)
      {
          sort($namespaces);
  
          $result = array();
          foreach ($namespaces as $namespace) {
              if (!$namespace) {
                  $namespace = 'global';
              }
  
              $namespace_list = explode('\\', $namespace);
  
              $node = &$result;
              foreach ($namespace_list as $singular) {
                  if (!isset($node[$singular])) {
                      $node[$singular] = array();
                  }
  
                  $node = &$node[$singular];
              }
          }
  
          return $result;
      }
code: protected function generateNamespaceTree($namespaces)
      {
          sort($namespaces);
  
          $result = array();
          foreach ($namespaces as $namespace) {
              if (!$namespace) {
                  $namespace = 'global';
              }
  
              $namespace_list = explode('\\', $namespace);
  
              $node = &$result;
              foreach ($namespace_list as $singular) {
                  if (!isset($node[$singular])) {
                      $node[$singular] = array();
                  }
  
                  $node = &$node[$singular];
              }
          }
  
          return $result;
      }
code_tokens: protected function generateNamespaceTree ( $ namespaces ) { sort ( $ namespaces ) ; $ result = array ( ) ; foreach ( $ namespaces as $ namespace ) { if ( ! $ namespace ) { $ namespace = 'global' ; } $ namespace_list = explode ( '\\' , $ namespace ) ; $ node = & $ result ; foreach ( $ namespace_list as $ singular ) { if ( ! isset ( $ node [ $ singular ] ) ) { $ node [ $ singular ] = array ( ) ; } $ node = & $ node [ $ singular ] ; } } return $ result ; }
docstring: Generates a hierarchical array of namespaces with their singular name
  from a single level list of namespaces with their full name.
  
  @param array $namespaces the list of namespaces as retrieved from the xml.
  
  @return array
docstring_tokens: Generates a hierarchical array of namespaces with their singular name from a single level list of namespaces with their full name .