public function render()
 {
     $editor = new OpenInEditor();
     $structure = (object) array('structure' => array());
     $isAll = true;
     foreach (Finder::findFiles('*Test.php')->from($this->dir) as $file) {
         $relative = substr($file, strlen($this->dir) + 1);
         $cursor =& $structure;
         foreach (explode(DIRECTORY_SEPARATOR, $relative) as $d) {
             $r = isset($cursor->relative) ? $cursor->relative . DIRECTORY_SEPARATOR : NULL;
             $cursor =& $cursor->structure[$d];
             $path = $this->dir . DIRECTORY_SEPARATOR . $r . $d;
             $open = $path === $this->open;
             if ($open) {
                 $isAll = false;
             }
             $cursor = (object) array('relative' => $r . $d, 'name' => $d, 'open' => $open, 'structure' => isset($cursor->structure) ? $cursor->structure : array(), 'editor' => $editor->link($path, 1), 'mode' => is_file($path) ? 'file' : 'folder');
             if (!$cursor->structure and $cursor->mode === 'file') {
                 foreach ($this->loadMethod($path) as $l => $m) {
                     $cursor->structure[$m] = (object) array('relative' => $cursor->relative . '::' . $m, 'name' => $m, 'open' => $cursor->open and $this->method === $m, 'structure' => array(), 'editor' => $editor->link($path, $l), 'mode' => 'method');
                 }
             }
         }
         $cursor->name = $file->getBasename();
     }
     $this->template->isAll = ($isAll and $this->open !== false);
     $this->template->basePath = TemplateFactory::getBasePath();
     $this->template->structure = $structure->structure;
     $this->template->setFile(__DIR__ . '/StructureRenderer.latte');
     $this->template->render();
 }