From b07975b91b7969f59eceaa810d5d12287321a480 Mon Sep 17 00:00:00 2001 From: Rostislav Wolny Date: Wed, 10 Apr 2019 18:19:50 +0200 Subject: [PATCH] Fix pQuery classes to respect psr-4 --- lib/Util/pQuery/DomNode.php | 15 +++++++++++++++ lib/Util/pQuery/Html5Parser.php | 8 ++++++++ lib/Util/pQuery/pQuery.php | 17 ----------------- 3 files changed, 23 insertions(+), 17 deletions(-) create mode 100644 lib/Util/pQuery/DomNode.php create mode 100644 lib/Util/pQuery/Html5Parser.php diff --git a/lib/Util/pQuery/DomNode.php b/lib/Util/pQuery/DomNode.php new file mode 100644 index 0000000000..e2cab3ebac --- /dev/null +++ b/lib/Util/pQuery/DomNode.php @@ -0,0 +1,15 @@ +toString(true, true, 1), ENT_NOQUOTES, 'UTF-8'); + } + + function getOuterText() { + return html_entity_decode($this->toString(), ENT_NOQUOTES, 'UTF-8'); + } +} diff --git a/lib/Util/pQuery/Html5Parser.php b/lib/Util/pQuery/Html5Parser.php new file mode 100644 index 0000000000..d993f86283 --- /dev/null +++ b/lib/Util/pQuery/Html5Parser.php @@ -0,0 +1,8 @@ +root; } } - -class Html5Parser extends \pQuery\HtmlParser { - /** @var string|\pQuery\DomNode */ - public $root = 'MailPoet\Util\pQuery\DomNode'; -} - -class DomNode extends \pQuery\DomNode { - public $childClass = 'MailPoet\Util\pQuery\DomNode'; - - function getInnerText() { - return html_entity_decode($this->toString(true, true, 1), ENT_NOQUOTES, 'UTF-8'); - } - - function getOuterText() { - return html_entity_decode($this->toString(), ENT_NOQUOTES, 'UTF-8'); - } -}