Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function generate()
 {
     foreach ($this->elementStorage->getNamespaces() as $name => $namespace) {
         $template = $this->templateFactory->createNamedForElement(TemplateFactory::ELEMENT_NAMESPACE, $name);
         $template = $this->namespaceAndPackageLoader->loadTemplateWithNamespace($template, $name, $namespace);
         $template->save();
         $this->eventDispatcher->dispatch(new GenerateProgressEvent(GeneratorEvents::ON_GENERATE_PROGRESS));
     }
 }
 public function generate()
 {
     foreach ($this->elementStorage->getNamespaces() as $name => $namespace) {
         $template = $this->templateFactory->createNamedForElement(TemplateFactory::ELEMENT_NAMESPACE, $name);
         $template = $this->namespaceAndPackageLoader->loadTemplateWithNamespace($template, $name, $namespace);
         $template->save();
         $this->onGenerateProgress();
     }
 }
Пример #3
0
 private function generateForElement(ElementReflectionInterface $element)
 {
     $template = $this->templateFactory->createNamedForElement('source', $element);
     $template = $this->namespaceAndPackageLoader->loadTemplateWithElementNamespaceOrPackage($template, $element);
     $template->setParameters(['fileName' => $this->relativePathResolver->getRelativePath($element->getFileName()), 'source' => $this->getHighlightedCodeFromElement($element)]);
     $template->save();
 }
 /**
  * @return Template
  */
 private function loadTemplateWithParameters(Template $template, ReflectionFunction $function)
 {
     $template = $this->namespaceAndPackageLoader->loadTemplateWithElementNamespaceOrPackage($template, $function);
     $template->setParameters(['function' => $function]);
     return $template;
 }
 /**
  * @return Template
  */
 private function loadTemplateWithParameters(Template $template, ReflectionClass $class)
 {
     $template = $this->namespaceAndPackageLoader->loadTemplateWithElementNamespaceOrPackage($template, $class);
     $template->setParameters(['class' => $class, 'tree' => array_merge(array_reverse($class->getParentClasses()), [$class]), 'directSubClasses' => $class->getDirectSubClasses(), 'indirectSubClasses' => $class->getIndirectSubClasses(), 'directImplementers' => $class->getDirectImplementers(), 'indirectImplementers' => $class->getIndirectImplementers(), 'directUsers' => $class->getDirectUsers(), 'indirectUsers' => $class->getIndirectUsers()]);
     return $template;
 }