PDepend\Source\AST\AbstractASTType::findChildrenOfType PHP Method

findChildrenOfType() public method

Will find all children for the given type.
public findChildrenOfType ( string $targetType, array &$results = [] ) : PDepend\Source\AST\ASTNode[]
$targetType string The target class or interface type.
$results array
return PDepend\Source\AST\ASTNode[]
    public function findChildrenOfType($targetType, array &$results = array())
    {
        foreach ($this->nodes as $node) {
            if ($node instanceof $targetType) {
                $results[] = $node;
            }
            $node->findChildrenOfType($targetType, $results);
        }
        foreach ($this->getMethods() as $method) {
            $method->findChildrenOfType($targetType, $results);
        }
        return $results;
    }