Пример #1
0
 /**
  * Export this function definition to the given parent DOMElement.
  *
  * @param \DOMElement        $parent   Element to augment.
  * @param FunctionDescriptor $function Element to export.
  * @param \DOMElement        $child    if supplied this element will be augmented instead of freshly added.
  *
  * @return void
  */
 public function buildFunction(\DOMElement $parent, FunctionDescriptor $function, \DOMElement $child = null)
 {
     if (!$child) {
         $child = new \DOMElement('function');
         $parent->appendChild($child);
     }
     $namespace = $function->getNamespace() ? $function->getNamespace() : $parent->getAttribute('namespace');
     $child->setAttribute('namespace', ltrim($namespace, '\\'));
     $child->setAttribute('line', $function->getLine());
     $child->appendChild(new \DOMElement('name', $function->getName()));
     $child->appendChild(new \DOMElement('full_name', $function->getFullyQualifiedStructuralElementName()));
     $this->buildDocBlock($child, $function);
     foreach ($function->getArguments() as $argument) {
         $this->buildArgument($child, $argument);
     }
 }
 /**
  * Generates a URL from the given node or returns false if unable.
  *
  * @param string|Descriptor\FunctionDescriptor $node
  *
  * @return string|false
  */
 public function __invoke($node)
 {
     $converter = new QualifiedNameToUrlConverter();
     return '/namespaces/' . $converter->fromNamespace($node->getNamespace()) . '.html#function_' . $node->getName();
 }
 /**
  * Generates a URL from the given node or returns false if unable.
  *
  * @param \phpDocumentor\Descriptor\FunctionDescriptor $node
  *
  * @return string|false
  */
 public function __invoke($node)
 {
     $namespaceName = $node->getNamespace();
     $name = $node->getName();
     return '/namespaces/' . str_replace('\\', '.', ltrim($namespaceName, '\\')) . '.html#function_' . $name;
 }