Go\Proxy\AbstractProxy::getOverriddenFunction PHP Method

getOverriddenFunction() protected method

Creates a function code from Reflection
protected getOverriddenFunction ( ReflectionFunctionAbstrac\ReflectionFunctionAbstract $functionLike, string $body ) : string
$functionLike ReflectionFunctionAbstrac\ReflectionFunctionAbstract Reflection for method
$body string Body of method
return string
    protected function getOverriddenFunction(ReflectionFunctionAbstract $functionLike, $body)
    {
        $reflectionReturnType = PHP_VERSION_ID >= 50700 ? $functionLike->getReturnType() : '';
        $modifiersLine = '';
        if ($reflectionReturnType) {
            $nsPrefix = $reflectionReturnType->isBuiltin() ? '' : '\\';
            $reflectionReturnType = $nsPrefix . (string) $reflectionReturnType;
        }
        if ($functionLike instanceof ReflectionMethod) {
            $modifiersLine = join(' ', Reflection::getModifierNames($functionLike->getModifiers()));
        }
        $code = preg_replace('/ {4}|\\t/', '', $functionLike->getDocComment()) . "\n" . $modifiersLine . ' function ' . ($functionLike->returnsReference() ? '&' : '') . $functionLike->name . '(' . join(', ', $this->getParameters($functionLike->getParameters())) . ")" . ($reflectionReturnType ? " : {$reflectionReturnType}" : '') . "\n" . "{\n" . $this->indent($body) . "\n" . "}\n";
        return $code;
    }