Pinq\Parsing\FunctionLocation::fromReflection PHP Метод

fromReflection() публичный статический Метод

Creates a function location instance from the supplied reflection.
public static fromReflection ( ReflectionFunctionAbstract $reflection ) : self
$reflection ReflectionFunctionAbstract
Результат self
    public static function fromReflection(\ReflectionFunctionAbstract $reflection)
    {
        if ($reflection instanceof \ReflectionFunction) {
            $namespace = $reflection->getNamespaceName();
        } elseif ($reflection instanceof \ReflectionMethod) {
            $namespace = $reflection->getDeclaringClass()->getNamespaceName();
        } else {
            $namespace = null;
        }
        return new self($reflection->getFileName(), $namespace, $reflection->getStartLine(), $reflection->getEndLine());
    }