/**
  * Generates a Markdown link to the given Descriptor or returns the link text if no route to the Descriptor could
  * be matched.
  *
  * @param DescriptorAbstract $element
  * @param string             $link
  * @param string             $description
  *
  * @return string
  */
 private function resolveElement(DescriptorAbstract $element, $link, $description)
 {
     $rule = $this->router->match($element);
     if ($rule) {
         $url = '..' . $rule->generate($element);
         $link = $this->generateMarkdownLink($url, $description ?: $link);
     }
     return $link;
 }
 /**
  * Adds the 'inherited_from' tag when a Descriptor inherits from another Descriptor.
  *
  * @param \DOMElement        $docBlock
  * @param DescriptorAbstract $descriptor
  *
  * @return void
  */
 protected function addInheritedFromTag(\DOMElement $docBlock, $descriptor)
 {
     $parentElement = $descriptor->getInheritedElement();
     if (!$parentElement instanceof $descriptor) {
         return;
     }
     $child = new \DOMElement('tag');
     $docBlock->appendChild($child);
     $rule = $this->router->match($parentElement);
     $child->setAttribute('name', 'inherited_from');
     $child->setAttribute('description', $parentElement->getFullyQualifiedStructuralElementName());
     $child->setAttribute('refers', $parentElement->getFullyQualifiedStructuralElementName());
     $child->setAttribute('link', $rule ? $rule->generate($parentElement) : '');
 }