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());
    }