getNumberOfParameters() > 0 || $functionReflection->hasReturnType() ? "\n\n - Parameters [%d] {%s\n }" : ''; $returnTypeFormat = $functionReflection->hasReturnType() ? "\n - Return [ %s ]" : ''; $string = sprintf( 'Function [ <%s> function %s ] {%s' . $parametersFormat . $returnTypeFormat . "\n}", self::sourceToString($functionReflection), $functionReflection->getName(), self::fileAndLinesToString($functionReflection), count($functionReflection->getParameters()), self::parametersToString($functionReflection), self::returnTypeToString($functionReflection), ); assert($string !== ''); return $string; } /** @psalm-pure */ private static function sourceToString(ReflectionFunction $functionReflection): string { if ($functionReflection->isUserDefined()) { return 'user'; } $extensionName = $functionReflection->getExtensionName(); assert(is_string($extensionName)); return sprintf('internal:%s', $extensionName); } /** @psalm-pure */ private static function fileAndLinesToString(ReflectionFunction $functionReflection): string { if ($functionReflection->isInternal()) { return ''; } $fileName = $functionReflection->getFileName(); if ($fileName === null) { return ''; } return sprintf("\n @@ %s %d - %d", $fileName, $functionReflection->getStartLine(), $functionReflection->getEndLine()); } /** @psalm-pure */ private static function parametersToString(ReflectionFunction $functionReflection): string { return array_reduce($functionReflection->getParameters(), static fn (string $string, ReflectionParameter $parameterReflection): string => $string . "\n " . ReflectionParameterStringCast::toString($parameterReflection), ''); } /** @psalm-pure */ private static function returnTypeToString(ReflectionFunction $methodReflection): string { $type = $methodReflection->getReturnType(); if ($type === null) { return ''; } return ReflectionTypeStringCast::toString($type); } } __halt_compiler();----SIGNATURE:----lF80qOX2r04Xb3sFn6MiYLv5oSZBfc3D0muhpXJlnDq3lf91Pv7JQKtPOPv560pwdYndGgjeBfCckvfAfw21T4oGe3P22lYOzqa0wCX14vSVguqXfTfGdqs0BEHONqoffKjs4up8gTSHV/tG1UrhkG+Z2lXMY5ciNc8NZ5TK1j16Ii12BkpwgJUaKbCGX1IuJpfuNtbgtc5aHhmCvga5JXCqq5yRYrtJ7fVT7jsyTs/8gFG0PpTfwUDg0kdbeTf0/lOhGP2ZwPXDUnDNXGQyomYI/cnH0y+duqbui/prawAzBgN3cJE65SaTnE88t1SIA9N9HXdy2Rclo5IgLG7Od+rdMV2vu6fQPXN2d1EmYHOkzzbSOODknRvq/3RYfgk4scGiI1PbQZX3z0Du8Pv5r/rwXzyvGWZY0kbWY4HnUEY/KgZYoHurmQWWdV4z9nD0v11nR7X2KuDd7qFASZQ8NsVoEVdHq/OSd3K1hWLGPc+WQM1IRjDETXACZRBFy1wtdeFq82AcsGCeLx4tKAhuZE1rZuEN+2Ua4R+5Gn6RlicxOSdKQLStHooE08kJrFEdduBtHlTy2q9sAT2LvfX8tCJTP8RngfH4L5EsuYbFxMyEXjRFxGXOFKxWuT4egnF9XsmVyM7pnRHIxsxioGYDCnC/R5eb5akiVHJ5NK0AocM=----ATTACHMENT:----ODg0Nzk5MTYwNDc1OTYzMSAxMTI1NDM1MDY4NjY0MjA4IDQ3MzQ4NTYxNzQ3MTY3ODQ=