/**
  * @param string $namespace
  * @param bool $skipLast
  * @return string
  */
 public function namespaceLinks($namespace, $skipLast = true)
 {
     if (!$this->elementStorage->getNamespaces()) {
         return $namespace;
     }
     $links = [];
     $parent = '';
     foreach (explode('\\', $namespace) as $part) {
         $parent = ltrim($parent . '\\' . $part, '\\');
         $links[] = $skipLast || $parent !== $namespace ? $this->linkBuilder->build($this->namespaceUrl($parent), $part) : $part;
     }
     return implode('\\', $links);
 }
Ejemplo n.º 2
0
 /**
  * @param string $value
  * @return string
  */
 private function processLinkAnnotations($value)
 {
     list($url, $description) = Strings::split($value);
     if (Validators::isUrl($url)) {
         return $this->linkBuilder->build($url, $description ?: $url);
     }
     return null;
 }
Ejemplo n.º 3
0
 /**
  * @return string
  */
 private function createForFunction(FunctionReflectionInterface $reflectionFunction, array $classes)
 {
     return $this->linkBuilder->build($this->elementUrlFactory->createForFunction($reflectionFunction), $reflectionFunction->getName() . '()', TRUE, $classes);
 }