Parser/Node.php
public function find($type)
    {

        foreach ($this->children as $node) {

            if ($node->type === $type)
                yield $node;

            foreach ($node->find($type) as $subNode)
                yield $subNode;
        }
    }
public function find($type)
    {

        foreach ($this->children as $node) {

            if ($node->type === $type)
                yield $node;

            foreach ($node->find($type) as $subNode)
                yield $subNode;
        }
    }
public function find ( $ type ) { foreach ( $ this -> children as $ node ) { if ( $ node -> type === $ type ) yield $ node ; foreach ( $ node -> find ( $ type ) as $ subNode ) yield $ subNode ; } }
Finds nodes with the given type inside this nodes children.

Plus all it's children-children recursively and returns a generator
providing them

This is used to collect all blocks, imports and mixins and handle them
in a special way

If you need a normal array, use ->findArray() instead instead

@param string $type the node type to search for

@return \Generator a generator of the found children
Finds nodes with the given type inside this nodes children .