/** * 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_[] */ public function getReturnStatementsAst() { $visitor = new ReturnNodeVisitor(); $traverser = new NodeTraverser(); $traverser->addVisitor($visitor); $traverser->traverse($this->node->getStmts()); return $visitor->getReturnNodes(); }