public function generate() { $annotations = $this->configuration->getOption('annotationGroups'); foreach ($annotations as $annotation) { $template = $this->templateFactory->createNamedForElement(TemplateFactory::ELEMENT_ANNOTATION_GROUP, $annotation); $template = $this->setElementsWithAnnotationToTemplate($template, $annotation); $template->save(); } }
/** * @param ElementReflectionInterface $element * @param bool $withLine Include file line number into the link * @return string */ public function sourceUrl(ElementReflectionInterface $element, $withLine = TRUE) { $file = ''; if ($this->isDirectUrl($element)) { $elementName = $element->getName(); if ($element instanceof ClassReflectionInterface) { $file = 'class-'; } elseif ($element instanceof ConstantReflectionInterface) { $file = 'constant-'; } elseif ($element instanceof FunctionReflectionInterface) { $file = 'function-'; } } else { $elementName = $element->getDeclaringClassName(); $file = 'class-'; } $file .= $this->urlize($elementName); $url = sprintf($this->configuration->getOption('template')['templates']['source']['filename'], $file); if ($withLine) { $url .= $this->getElementLinesAnchor($element); } return $url; }
/** * @param string $name * @return string */ public function createForAnnotationGroup($name) { return sprintf($this->configuration->getOption(CO::TEMPLATE)['templates'][TCO::ANNOTATION_GROUP]['filename'], Filters::urlize($name)); }