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());
    }
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());
    }
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 ( ) ) ; }
Creates a function location instance from the supplied reflection.

@param \ReflectionFunctionAbstract $reflection

@return self
Creates a function location instance from the supplied reflection .