public function replaceAll($targets) {
    if ($targets instanceof Node) {
      $targets->replaceWith($this->nodes);
    }
    elseif ($targets instanceof NodeCollection || is_array($targets)) {
      $first = TRUE;
      /** @var Node $target */
      foreach ($targets as $target) {
        $target->replaceWith($first ? $this->nodes : clone $this);
        $first = FALSE;
      }
    }
    return $this;
  }
public function replaceAll($targets) {
    if ($targets instanceof Node) {
      $targets->replaceWith($this->nodes);
    }
    elseif ($targets instanceof NodeCollection || is_array($targets)) {
      $first = TRUE;
      /** @var Node $target */
      foreach ($targets as $target) {
        $target->replaceWith($first ? $this->nodes : clone $this);
        $first = FALSE;
      }
    }
    return $this;
  }
public function replaceAll ( $ targets ) { if ( $ targets instanceof Node ) { $ targets -> replaceWith ( $ this -> nodes ) ; } elseif ( $ targets instanceof NodeCollection || is_array ( $ targets ) ) { $ first = TRUE ; /** @var Node $target */ foreach ( $ targets as $ target ) { $ target -> replaceWith ( $ first ? $ this -> nodes : clone $ this ) ; $ first = FALSE ; } } return $ this ; }
Replace each target node with the set of matched nodes.
@param Node|Node[]|NodeCollection $targets Targets to replace.
@return $this
Replace each target node with the set of matched nodes .