public function exportFunction(\ReflectionFunctionAbstract $function, int $excludeModifiers = 0) : string
    {
        $result = '';

        if ($function instanceof \ReflectionMethod) {
            $modifiers = $function->getModifiers();
            $modifiers &= ~ $excludeModifiers;

            foreach (\Reflection::getModifierNames($modifiers) as $modifier) {
                $result .= $modifier . ' ';
            }
        }

        $result .= 'function ' . $function->getShortName();
        $result .= '(' . $this->exportFunctionParameters($function) . ')';

        if (null !== $returnType = $function->getReturnType()) {
            $result .= ' : ';

            if ($returnType->allowsNull()) {
                $result .= '?';
            }

            if (! $returnType->isBuiltin()) {
                $result .= '\\';
            }

            $result .= $returnType->getName();
        }

        return $result;
    }
public function exportFunction(\ReflectionFunctionAbstract $function, int $excludeModifiers = 0) : string
    {
        $result = '';

        if ($function instanceof \ReflectionMethod) {
            $modifiers = $function->getModifiers();
            $modifiers &= ~ $excludeModifiers;

            foreach (\Reflection::getModifierNames($modifiers) as $modifier) {
                $result .= $modifier . ' ';
            }
        }

        $result .= 'function ' . $function->getShortName();
        $result .= '(' . $this->exportFunctionParameters($function) . ')';

        if (null !== $returnType = $function->getReturnType()) {
            $result .= ' : ';

            if ($returnType->allowsNull()) {
                $result .= '?';
            }

            if (! $returnType->isBuiltin()) {
                $result .= '\\';
            }

            $result .= $returnType->getName();
        }

        return $result;
    }
public function exportFunction ( \ ReflectionFunctionAbstract $ function , int $ excludeModifiers = 0 ) : string { $ result = '' ; if ( $ function instanceof \ ReflectionMethod ) { $ modifiers = $ function -> getModifiers ( ) ; $ modifiers &= ~ $ excludeModifiers ; foreach ( \ Reflection :: getModifierNames ( $ modifiers ) as $ modifier ) { $ result .= $ modifier . ' ' ; } } $ result .= 'function ' . $ function -> getShortName ( ) ; $ result .= '(' . $ this -> exportFunctionParameters ( $ function ) . ')' ; if ( null !== $ returnType = $ function -> getReturnType ( ) ) { $ result .= ' : ' ; if ( $ returnType -> allowsNull ( ) ) { $ result .= '?' ; } if ( ! $ returnType -> isBuiltin ( ) ) { $ result .= '\\' ; } $ result .= $ returnType -> getName ( ) ; } return $ result ; }
Exports the function signature.

@param \ReflectionFunctionAbstract $function         The function to export.
@param int                         $excludeModifiers An optional bitmask of modifiers to exclude.

@return string
Exports the function signature .