diff options
author | Andres Rey <[email protected]> | 2017-12-01 21:05:04 +0000 |
---|---|---|
committer | Andres Rey <[email protected]> | 2017-12-01 21:05:04 +0000 |
commit | 7c8ee690e3c33c6a25670fba203ae14d1e1bea6e (patch) | |
tree | 74b057e92ff907b42c9419ab8146aadb697938a9 /src/Nodes/DOM/DOMDocument.php | |
parent | ecebda06241ff34eac70b247c74175b162902582 (diff) |
Move the DOM classes to its own namespace
Diffstat (limited to 'src/Nodes/DOM/DOMDocument.php')
-rw-r--r-- | src/Nodes/DOM/DOMDocument.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Nodes/DOM/DOMDocument.php b/src/Nodes/DOM/DOMDocument.php new file mode 100644 index 0000000..b99d464 --- /dev/null +++ b/src/Nodes/DOM/DOMDocument.php @@ -0,0 +1,28 @@ +<?php + +namespace andreskrey\Readability\Nodes\DOM; + +use andreskrey\Readability\Nodes\NodeTrait; + +class DOMDocument extends \DOMDocument +{ + use NodeTrait; + + public function __construct($version, $encoding) + { + parent::__construct($version, $encoding); + + $this->registerNodeClass('DOMAttr', DOMAttr::class); + $this->registerNodeClass('DOMCdataSection', DOMCdataSection::class); + $this->registerNodeClass('DOMCharacterData', DOMCharacterData::class); + $this->registerNodeClass('DOMComment', DOMComment::class); + $this->registerNodeClass('DOMDocument', self::class); + $this->registerNodeClass('DOMDocumentFragment', DOMDocumentFragment::class); + $this->registerNodeClass('DOMDocumentType', DOMDocumentType::class); + $this->registerNodeClass('DOMElement', DOMElement::class); + $this->registerNodeClass('DOMNode', DOMNode::class); + $this->registerNodeClass('DOMNotation', DOMNotation::class); + $this->registerNodeClass('DOMProcessingInstruction', DOMProcessingInstruction::class); + $this->registerNodeClass('DOMText', DOMText::class); + } +} |