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