DOMDocument.php 1.3 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. namespace andreskrey\Readability\Nodes\DOM;
  3. use andreskrey\Readability\Nodes\NodeTrait;
  4. class DOMDocument extends \DOMDocument
  5. {
  6. use NodeTrait;
  7. public function __construct($version, $encoding)
  8. {
  9. parent::__construct($version, $encoding);
  10. $this->registerNodeClass('DOMAttr', DOMAttr::class);
  11. $this->registerNodeClass('DOMCdataSection', DOMCdataSection::class);
  12. $this->registerNodeClass('DOMCharacterData', DOMCharacterData::class);
  13. $this->registerNodeClass('DOMComment', DOMComment::class);
  14. $this->registerNodeClass('DOMDocument', self::class);
  15. $this->registerNodeClass('DOMDocumentFragment', DOMDocumentFragment::class);
  16. $this->registerNodeClass('DOMDocumentType', DOMDocumentType::class);
  17. $this->registerNodeClass('DOMElement', DOMElement::class);
  18. $this->registerNodeClass('DOMEntity', DOMEntity::class);
  19. $this->registerNodeClass('DOMEntityReference', DOMEntityReference::class);
  20. $this->registerNodeClass('DOMNode', DOMNode::class);
  21. $this->registerNodeClass('DOMNotation', DOMNotation::class);
  22. $this->registerNodeClass('DOMProcessingInstruction', DOMProcessingInstruction::class);
  23. $this->registerNodeClass('DOMText', DOMText::class);
  24. }
  25. }