src/phpDocumentor/Compiler/Pass/PackageTreeBuilder.php
public function execute(ProjectDescriptor $project)
    {
        $rootPackageDescriptor = new PackageDescriptor();
        $rootPackageDescriptor->setName('\\');
        $project->getIndexes()->set('packages', new Collection());
        $project->getIndexes()->packages['\\'] = $rootPackageDescriptor;

        foreach ($project->getFiles() as $file) {
            $this->addElementsOfTypeToPackage($project, array($file), 'files');
            $this->addElementsOfTypeToPackage($project, $file->getConstants()->getAll(), 'constants');
            $this->addElementsOfTypeToPackage($project, $file->getFunctions()->getAll(), 'functions');
            $this->addElementsOfTypeToPackage($project, $file->getClasses()->getAll(), 'classes');
            $this->addElementsOfTypeToPackage($project, $file->getInterfaces()->getAll(), 'interfaces');
            $this->addElementsOfTypeToPackage($project, $file->getTraits()->getAll(), 'traits');
        }
    }
public function execute(ProjectDescriptor $project)
    {
        $rootPackageDescriptor = new PackageDescriptor();
        $rootPackageDescriptor->setName('\\');
        $project->getIndexes()->set('packages', new Collection());
        $project->getIndexes()->packages['\\'] = $rootPackageDescriptor;

        foreach ($project->getFiles() as $file) {
            $this->addElementsOfTypeToPackage($project, array($file), 'files');
            $this->addElementsOfTypeToPackage($project, $file->getConstants()->getAll(), 'constants');
            $this->addElementsOfTypeToPackage($project, $file->getFunctions()->getAll(), 'functions');
            $this->addElementsOfTypeToPackage($project, $file->getClasses()->getAll(), 'classes');
            $this->addElementsOfTypeToPackage($project, $file->getInterfaces()->getAll(), 'interfaces');
            $this->addElementsOfTypeToPackage($project, $file->getTraits()->getAll(), 'traits');
        }
    }
public function execute ( ProjectDescriptor $ project ) { $ rootPackageDescriptor = new PackageDescriptor ( ) ; $ rootPackageDescriptor -> setName ( '\\' ) ; $ project -> getIndexes ( ) -> set ( 'packages' , new Collection ( ) ) ; $ project -> getIndexes ( ) -> packages [ '\\' ] = $ rootPackageDescriptor ; foreach ( $ project -> getFiles ( ) as $ file ) { $ this -> addElementsOfTypeToPackage ( $ project , array ( $ file ) , 'files' ) ; $ this -> addElementsOfTypeToPackage ( $ project , $ file -> getConstants ( ) -> getAll ( ) , 'constants' ) ; $ this -> addElementsOfTypeToPackage ( $ project , $ file -> getFunctions ( ) -> getAll ( ) , 'functions' ) ; $ this -> addElementsOfTypeToPackage ( $ project , $ file -> getClasses ( ) -> getAll ( ) , 'classes' ) ; $ this -> addElementsOfTypeToPackage ( $ project , $ file -> getInterfaces ( ) -> getAll ( ) , 'interfaces' ) ; $ this -> addElementsOfTypeToPackage ( $ project , $ file -> getTraits ( ) -> getAll ( ) , 'traits' ) ; } }
Compiles a 'packages' index on the project and create all Package Descriptors necessary.

@param ProjectDescriptor $project

@return void
Compiles a packages index on the project and create all Package Descriptors necessary .