DomNode.php
28 lines
| 1 | <?php // phpcs:ignore SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing |
| 2 | |
| 3 | namespace MailPoet\Util\pQuery; |
| 4 | |
| 5 | if (!defined('ABSPATH')) exit; |
| 6 | |
| 7 | |
| 8 | use MailPoetVendor\pQuery\DomNode as pQueryDomNode; |
| 9 | |
| 10 | class DomNode extends pQueryDomNode { |
| 11 | public $childClass = DomNode::class; |
| 12 | public $parserClass = Html5Parser::class; |
| 13 | |
| 14 | public function getInnerText() { |
| 15 | return html_entity_decode($this->toString(true, true, 1), ENT_NOQUOTES, 'UTF-8'); |
| 16 | } |
| 17 | |
| 18 | public function getOuterText() { |
| 19 | return html_entity_decode($this->toString(), ENT_NOQUOTES, 'UTF-8'); |
| 20 | } |
| 21 | |
| 22 | public function query($query = '*') { |
| 23 | $select = $this->select($query); |
| 24 | $result = new pQuery((array)$select); |
| 25 | return $result; |
| 26 | } |
| 27 | } |
| 28 |