Exemplo n.º 1
0
 /**
  * Add new ClassElement into file under specified namespace.
  *
  * @param ClassElement $element
  * @param string       $namespace Virtual namespace by default.
  * @return string
  */
 protected function addClass(ClassElement $element, $namespace = null)
 {
     if (is_null($namespace)) {
         $namespace = $this->documenter->config()['namespace'];
     }
     if (!isset($this->namespaces[$namespace])) {
         $this->namespaces[$namespace] = new NamespaceElement(trim($namespace, '\\'));
         $this->file->addNamespace($this->namespaces[$namespace]);
     }
     $this->namespaces[$namespace]->addClass($element);
     $this->countClasses++;
     return '\\' . trim($namespace, '\\') . '\\' . $element->getName();
 }