public static function fromReflection(\ReflectionFunctionAbstract $reflection)
    {
        $returnsReference     = $reflection->returnsReference();
        $name                 = $reflection->getShortName();
        $parameterExpressions = self::getParameterExpressionsFromReflection($reflection);

        if ($reflection->isClosure()) {
            return self::closure(
                    $returnsReference,
                    $parameterExpressions,
                    array_keys($reflection->getStaticVariables())
            );
        } elseif ($reflection instanceof \ReflectionMethod) {
            if ($reflection->isPublic()) {
                $accessModifier = self::ACCESS_PUBLIC;
            } elseif ($reflection->isProtected()) {
                $accessModifier = self::ACCESS_PROTECTED;
            } else {
                $accessModifier = self::ACCESS_PRIVATE;
            }

            if ($reflection->isAbstract()) {
                $polymorphModifier = self::POLYMORPH_ABSTRACT;
            } elseif ($reflection->isFinal()) {
                $polymorphModifier = self::POLYMORPH_FINAL;
            } else {
                $polymorphModifier = null;
            }

            return self::method(
                    $returnsReference,
                    $accessModifier,
                    $polymorphModifier,
                    $reflection->isStatic(),
                    $name,
                    $parameterExpressions
            );
        } else {
            return self::func(
                    $returnsReference,
                    $name,
                    $parameterExpressions
            );
        }
    }
public static function fromReflection(\ReflectionFunctionAbstract $reflection)
    {
        $returnsReference     = $reflection->returnsReference();
        $name                 = $reflection->getShortName();
        $parameterExpressions = self::getParameterExpressionsFromReflection($reflection);

        if ($reflection->isClosure()) {
            return self::closure(
                    $returnsReference,
                    $parameterExpressions,
                    array_keys($reflection->getStaticVariables())
            );
        } elseif ($reflection instanceof \ReflectionMethod) {
            if ($reflection->isPublic()) {
                $accessModifier = self::ACCESS_PUBLIC;
            } elseif ($reflection->isProtected()) {
                $accessModifier = self::ACCESS_PROTECTED;
            } else {
                $accessModifier = self::ACCESS_PRIVATE;
            }

            if ($reflection->isAbstract()) {
                $polymorphModifier = self::POLYMORPH_ABSTRACT;
            } elseif ($reflection->isFinal()) {
                $polymorphModifier = self::POLYMORPH_FINAL;
            } else {
                $polymorphModifier = null;
            }

            return self::method(
                    $returnsReference,
                    $accessModifier,
                    $polymorphModifier,
                    $reflection->isStatic(),
                    $name,
                    $parameterExpressions
            );
        } else {
            return self::func(
                    $returnsReference,
                    $name,
                    $parameterExpressions
            );
        }
    }
public static function fromReflection ( \ ReflectionFunctionAbstract $ reflection ) { $ returnsReference = $ reflection -> returnsReference ( ) ; $ name = $ reflection -> getShortName ( ) ; $ parameterExpressions = self :: getParameterExpressionsFromReflection ( $ reflection ) ; if ( $ reflection -> isClosure ( ) ) { return self :: closure ( $ returnsReference , $ parameterExpressions , array_keys ( $ reflection -> getStaticVariables ( ) ) ) ; } elseif ( $ reflection instanceof \ ReflectionMethod ) { if ( $ reflection -> isPublic ( ) ) { $ accessModifier = self :: ACCESS_PUBLIC ; } elseif ( $ reflection -> isProtected ( ) ) { $ accessModifier = self :: ACCESS_PROTECTED ; } else { $ accessModifier = self :: ACCESS_PRIVATE ; } if ( $ reflection -> isAbstract ( ) ) { $ polymorphModifier = self :: POLYMORPH_ABSTRACT ; } elseif ( $ reflection -> isFinal ( ) ) { $ polymorphModifier = self :: POLYMORPH_FINAL ; } else { $ polymorphModifier = null ; } return self :: method ( $ returnsReference , $ accessModifier , $ polymorphModifier , $ reflection -> isStatic ( ) , $ name , $ parameterExpressions ) ; } else { return self :: func ( $ returnsReference , $ name , $ parameterExpressions ) ; } }
Creates a function signature instance from the supplied reflection.

@param \ReflectionFunctionAbstract $reflection

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