Crawler.php
public function addNode(\DOMNode $node)
    {
        if ($node instanceof \DOMDocument) {
            $node = $node->documentElement;
        }

        if (null !== $this->document && $this->document !== $node->ownerDocument) {
            throw new \InvalidArgumentException('Attaching DOM nodes from multiple documents in the same crawler is forbidden.');
        }

        if (null === $this->document) {
            $this->document = $node->ownerDocument;
        }

        // Don't add duplicate nodes in the Crawler
        if (in_array($node, $this->nodes, true)) {
            return;
        }

        $this->nodes[] = $node;
    }
public function addNode(\DOMNode $node)
    {
        if ($node instanceof \DOMDocument) {
            $node = $node->documentElement;
        }

        if (null !== $this->document && $this->document !== $node->ownerDocument) {
            throw new \InvalidArgumentException('Attaching DOM nodes from multiple documents in the same crawler is forbidden.');
        }

        if (null === $this->document) {
            $this->document = $node->ownerDocument;
        }

        // Don't add duplicate nodes in the Crawler
        if (in_array($node, $this->nodes, true)) {
            return;
        }

        $this->nodes[] = $node;
    }
public function addNode ( \ DOMNode $ node ) { if ( $ node instanceof \ DOMDocument ) { $ node = $ node -> documentElement ; } if ( null !== $ this -> document && $ this -> document !== $ node -> ownerDocument ) { throw new \ InvalidArgumentException ( 'Attaching DOM nodes from multiple documents in the same crawler is forbidden.' ) ; } if ( null === $ this -> document ) { $ this -> document = $ node -> ownerDocument ; } // Don't add duplicate nodes in the Crawler if ( in_array ( $ node , $ this -> nodes , true ) ) { return ; } $ this -> nodes [ ] = $ node ; }
Adds a \DOMNode instance to the list of nodes.

@param \DOMNode $node A \DOMNode instance
Adds a \ DOMNode instance to the list of nodes .