public function replaceWith($nodes) {
    $first = TRUE;
    foreach ($this->nodes as $node) {
      if (!$first) {
        if (is_array($nodes)) {
          $nodes = new NodeCollection($nodes, FALSE);
        }
        $nodes = clone $nodes;
      }
      $node->replaceWith($nodes);
      $first = FALSE;
    }
    return $this;
  }
public function replaceWith($nodes) {
    $first = TRUE;
    foreach ($this->nodes as $node) {
      if (!$first) {
        if (is_array($nodes)) {
          $nodes = new NodeCollection($nodes, FALSE);
        }
        $nodes = clone $nodes;
      }
      $node->replaceWith($nodes);
      $first = FALSE;
    }
    return $this;
  }
public function replaceWith ( $ nodes ) { $ first = TRUE ; foreach ( $ this -> nodes as $ node ) { if ( ! $ first ) { if ( is_array ( $ nodes ) ) { $ nodes = new NodeCollection ( $ nodes , FALSE ) ; } $ nodes = clone $ nodes ; } $ node -> replaceWith ( $ nodes ) ; $ first = FALSE ; } return $ this ; }
Replace each node in the set of matched nodes with the provided new nodes
and return the set of nodes that was removed.
@param Node|Node[]|NodeCollection $nodes Replacement nodes.
@return $this
Replace each node in the set of matched nodes with the provided new nodes and return the set of nodes that was removed .