src/Reflection/ReflectionFunctionAbstract.php
public function getBodyCode(?PrettyPrinterAbstract $printer = null) : string
    {
        if ($printer === null) {
            $printer = new StandardPrettyPrinter();
        }

        return $printer->prettyPrint($this->getBodyAst());
    }
public function getBodyCode(?PrettyPrinterAbstract $printer = null) : string
    {
        if ($printer === null) {
            $printer = new StandardPrettyPrinter();
        }

        return $printer->prettyPrint($this->getBodyAst());
    }
Retrieves the body of this function as code.

If a PrettyPrinter is provided as a parameter, it will be used, otherwise
a default will be used.

Note that the formatting of the code may not be the same as the original
function. If specific formatting is required, you should provide your
own implementation of a PrettyPrinter to unparse the AST.