/** * @param string $text * @param ElementReflectionInterface $reflectionElement * @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); }
/** * @param string $value * @return string */ private function processLinkAnnotations($value) { list($url, $description) = Strings::split($value); if (Validators::isUri($url)) { return $this->linkBuilder->build($url, $description ?: $url); } return null; }