findChildrenOfType() public méthode

This method will search recursive for all child nodes that are an instance of the given $targetType. The returned value will be an empty array if no child exists for that.
public findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[]
$targetType string Searched class or interface type.
$results array
Résultat PDepend\Source\AST\ASTNode[]
 /**
  * Searches recursive for all children of this node that are of the given
  * type.
  *
  * @param string $type The searched child type.
  * @return \PHPMD\AbstractNode[]
  */
 public function findChildrenOfType($type)
 {
     $children = $this->node->findChildrenOfType('PDepend\\Source\\AST\\AST' . $type);
     $nodes = array();
     foreach ($children as $child) {
         $nodes[] = new ASTNode($child, $this->getFileName());
     }
     return $nodes;
 }