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".');
}