private resolveLinkAndSeeAnnotation ( string $text, ApiGen\Contracts\Parser\Reflection\ElementReflectionInterface $reflectionElement ) : string | ||
$text | string | |
$reflectionElement | ApiGen\Contracts\Parser\Reflection\ElementReflectionInterface | |
return | string |
private function resolveLinkAndSeeAnnotation($text, ElementReflectionInterface $reflectionElement)
{
return preg_replace_callback('~{@(?:link|see)\\s+([^}]+)}~', function ($matches) use($reflectionElement) {
list($url, $description) = Strings::split($matches[1]);
if ($link = $this->resolveLink($matches[1], $reflectionElement)) {
return $link;
}
if (Validators::isUri($url)) {
return $this->linkBuilder->build($url, $description ?: $url);
}
return $matches[1];
}, $text);
}