PhpParser\Node\FunctionLike::getStmts PHP Method

getStmts() public method

The function body
public getStmts ( ) : PhpParser\Node\Stmt[]
return PhpParser\Node\Stmt[]
    public function getStmts();

Usage Example

 private function getVariableAccesses(FunctionLike $function) : array
 {
     $traverser = new NodeTraverser();
     $accessLocator = new VariableAccessLocatorVisitor();
     $traverser->addVisitor(new FunctionScopeIsolatingVisitor($accessLocator));
     $traverser->traverse([$function->getStmts()]);
     return $accessLocator->getFoundVariableAccesses();
 }
All Usage Examples Of PhpParser\Node\FunctionLike::getStmts