/** * Get filename to export rendered declaration into. * * @return ClassElement */ public function getFilename() { $filename = $this->options['directory'] . FilesInterface::SEPARATOR; //Default namespace already included into path $namespace = trim(substr($this->file->getNamespace(), strlen($this->options['namespace']) + 1), '\\'); $filename .= str_replace('\\', FilesInterface::SEPARATOR, $namespace); return $filename . FilesInterface::SEPARATOR . $this->class->getName() . static::EXTENSION; }
/** * 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(); }