public function is($document)
    {
        if ($document instanceof Document) {
            $element = $document->getElement();
        } else {
            if (!$document instanceof DOMDocument) {
                throw new InvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s or DOMDocument, %s given', __METHOD__, __CLASS__, (is_object($document) ? get_class($document) : gettype($document))));
            }

            $element = $document->documentElement;
        }

        if ($element === null) {
            return false;
        }

        return $this->getElement()->isSameNode($element);
    }
public function is($document)
    {
        if ($document instanceof Document) {
            $element = $document->getElement();
        } else {
            if (!$document instanceof DOMDocument) {
                throw new InvalidArgumentException(sprintf('Argument 1 passed to %s must be an instance of %s or DOMDocument, %s given', __METHOD__, __CLASS__, (is_object($document) ? get_class($document) : gettype($document))));
            }

            $element = $document->documentElement;
        }

        if ($element === null) {
            return false;
        }

        return $this->getElement()->isSameNode($element);
    }
public function is ( $ document ) { if ( $ document instanceof Document ) { $ element = $ document -> getElement ( ) ; } else { if ( ! $ document instanceof DOMDocument ) { throw new InvalidArgumentException ( sprintf ( 'Argument 1 passed to %s must be an instance of %s or DOMDocument, %s given' , __METHOD__ , __CLASS__ , ( is_object ( $ document ) ? get_class ( $ document ) : gettype ( $ document ) ) ) ) ; } $ element = $ document -> documentElement ; } if ( $ element === null ) { return false ; } return $ this -> getElement ( ) -> isSameNode ( $ element ) ; }
Indicates if two documents are the same document.

@param \DiDom\Document|\DOMDocument $document The compared document

@return bool

@throws \InvalidArgumentException if the provided argument is not an instance of \DOMDocument or \DiDom\Document
Indicates if two documents are the same document .