src/Reflection/ReflectionFunctionAbstract.php
public function getReturnStatementsAst() : array
    {
        $visitor = new ReturnNodeVisitor();

        $traverser = new NodeTraverser();
        $traverser->addVisitor($visitor);

        $traverser->traverse($this->node->getStmts());

        return $visitor->getReturnNodes();
    }
public function getReturnStatementsAst() : array
    {
        $visitor = new ReturnNodeVisitor();

        $traverser = new NodeTraverser();
        $traverser->addVisitor($visitor);

        $traverser->traverse($this->node->getStmts());

        return $visitor->getReturnNodes();
    }
Fetch an array of all return statements found within this function.

Note that return statements within smaller scopes contained (e.g. anonymous classes, closures) are not returned
here as they are not within the immediate scope.

@return Node\Stmt\Return_[]