ApiGen\Templating\Filters\Helpers\ElementLinkFactory::createForElement PHP Метод

createForElement() публичный метод

public createForElement ( ApiGen\Contracts\Parser\Reflection\ElementReflectionInterface $element, array $classes = [] ) : string
$element ApiGen\Contracts\Parser\Reflection\ElementReflectionInterface
$classes array
Результат string
    public function createForElement(ElementReflectionInterface $element, array $classes = [])
    {
        if ($element instanceof ClassReflectionInterface) {
            return $this->createForClass($element, $classes);
        } elseif ($element instanceof MethodReflectionInterface) {
            return $this->createForMethod($element, $classes);
        } elseif ($element instanceof PropertyReflectionInterface) {
            return $this->createForProperty($element, $classes);
        } elseif ($element instanceof ConstantReflectionInterface) {
            return $this->createForConstant($element, $classes);
        } elseif ($element instanceof FunctionReflectionInterface) {
            return $this->createForFunction($element, $classes);
        }
        throw new UnexpectedValueException('Descendant of ApiGen\\Reflection\\Reflection class expected. Got "' . get_class($element) . ' class".');
    }

Usage Example

Пример #1
0
 /**
  * @return string
  */
 private function createLinkForElement($reflectionElement, array $classes)
 {
     return $this->elementLinkFactory->createForElement($reflectionElement, $classes);
 }