PhpParser\Node\Stmt\ClassMethod::getStmts PHP Method

getStmts() public method

public getStmts ( )
    public function getStmts() {
        return $this->stmts;
    }

Usage Example

 /**
  * 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();
 }