src/phpDocumentor/Plugin/Core/Transformer/Writer/Xml.php
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;
    }
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;
    }
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 ; }
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
Generates a hierarchical array of namespaces with their singular name from a single level list of namespaces with their full name .