/** * @return Template */ public function addElementsToTemplate(Template $template) { return $template->setParameters($this->getParameters()); }
/** * @param Template $template * @param array $elements * @return Template */ private function loadTemplateWithElements(Template $template, $elements) { return $template->setParameters([Elements::CLASSES => $elements[Elements::CLASSES], Elements::INTERFACES => $elements[Elements::INTERFACES], Elements::TRAITS => $elements[Elements::TRAITS], Elements::EXCEPTIONS => $elements[Elements::EXCEPTIONS], Elements::CONSTANTS => $elements[Elements::CONSTANTS], Elements::FUNCTIONS => $elements[Elements::FUNCTIONS]]); }
/** * @param Template $template * @param string $annotation * @return Template */ private function setElementsWithAnnotationToTemplate(Template $template, $annotation) { $elements = $this->elementExtractor->extractElementsByAnnotation($annotation); $template->setParameters(['annotation' => $annotation, 'hasElements' => (bool) count(array_filter($elements, 'count')), 'annotationClasses' => $elements[Elements::CLASSES], 'annotationInterfaces' => $elements[Elements::INTERFACES], 'annotationTraits' => $elements[Elements::TRAITS], 'annotationExceptions' => $elements[Elements::EXCEPTIONS], 'annotationConstants' => $elements[Elements::CONSTANTS], 'annotationMethods' => $elements[Elements::METHODS], 'annotationFunctions' => $elements[Elements::FUNCTIONS], 'annotationProperties' => $elements[Elements::PROPERTIES]]); return $template; }
/** * @return Template */ private function setEmptyDefaults(Template $template) { return $template->setParameters(['namespace' => NULL, 'package' => NULL]); }