src/PHPHtmlParser/Dom/InnerNode.php
public function removeChild(int $id): InnerNode
    {
        if ( ! isset($this->children[$id])) {
            return $this;
        }

        // handle moving next and previous assignments.
        $next = $this->children[$id]['next'];
        $prev = $this->children[$id]['prev'];
        if ( ! is_null($next)) {
            $this->children[$next]['prev'] = $prev;
        }
        if ( ! is_null($prev)) {
            $this->children[$prev]['next'] = $next;
        }

        // remove the child
        unset($this->children[$id]);

        //clear any cache
        $this->clear();

        return $this;
    }
public function removeChild(int $id): InnerNode
    {
        if ( ! isset($this->children[$id])) {
            return $this;
        }

        // handle moving next and previous assignments.
        $next = $this->children[$id]['next'];
        $prev = $this->children[$id]['prev'];
        if ( ! is_null($next)) {
            $this->children[$next]['prev'] = $prev;
        }
        if ( ! is_null($prev)) {
            $this->children[$prev]['next'] = $next;
        }

        // remove the child
        unset($this->children[$id]);

        //clear any cache
        $this->clear();

        return $this;
    }
public function removeChild ( int $ id ) : InnerNode { if ( ! isset ( $ this -> children [ $ id ] ) ) { return $ this ; } // handle moving next and previous assignments. $ next = $ this -> children [ $ id ] [ 'next' ] ; $ prev = $ this -> children [ $ id ] [ 'prev' ] ; if ( ! is_null ( $ next ) ) { $ this -> children [ $ next ] [ 'prev' ] = $ prev ; } if ( ! is_null ( $ prev ) ) { $ this -> children [ $ prev ] [ 'next' ] = $ next ; } // remove the child unset ( $ this -> children [ $ id ] ) ; //clear any cache $ this -> clear ( ) ; return $ this ; }
Removes the child by id.

@param int $id
@return InnerNode
@chainable
Removes the child by id .