public function find(callable $callback) {
    $matches = [];
    foreach ($this->nodes as $node) {
      if ($node instanceof ParentNode) {
        $matches = array_merge($matches, $node->find($callback)->nodes);
      }
    }
    return new NodeCollection($matches);
  }
public function find(callable $callback) {
    $matches = [];
    foreach ($this->nodes as $node) {
      if ($node instanceof ParentNode) {
        $matches = array_merge($matches, $node->find($callback)->nodes);
      }
    }
    return new NodeCollection($matches);
  }
public function find ( callable $ callback ) { $ matches = [ ] ; foreach ( $ this -> nodes as $ node ) { if ( $ node instanceof ParentNode ) { $ matches = array_merge ( $ matches , $ node -> find ( $ callback ) -> nodes ) ; } } return new NodeCollection ( $ matches ) ; }
Get the descendants of each node in the current set of matched nodes,
filtered by callback.
@param callable $callback Callback to filter by.
@return NodeCollection
Get the descendants of each node in the current set of matched nodes filtered by callback .