Beispiel #1
0
 public function getTree(Project $project)
 {
     $namespaces = array();
     $ns = $project->getConfig('simulate_namespaces') ? $project->getSimulatedNamespaces() : $project->getNamespaces();
     foreach ($ns as $namespace) {
         if (false !== ($pos = strpos($namespace, '\\'))) {
             $namespaces[substr($namespace, 0, strpos($namespace, '\\'))][] = $namespace;
         } else {
             $namespaces[$namespace][] = $namespace;
         }
     }
     return $this->generateClassTreeLevel($project, 1, $namespaces, array());
 }
 public function __construct(Project $project = null)
 {
     $this->classes = array();
     if (null !== $project) {
         foreach ($project->getProjectClasses() as $class) {
             $this->classes[$class->getName()] = $class->getHash();
         }
     }
     $this->versions = array();
     if (null !== $project) {
         foreach ($project->getVersions() as $version) {
             $this->versions[] = (string) $version;
         }
     }
     $this->namespaces = array();
     if (null !== $project) {
         $this->namespaces = $project->getConfig('simulate_namespaces') ? $project->getSimulatedNamespaces() : $project->getNamespaces();
     }
 }