Fix deprecation warnings coming from pQuery library

[MAILPOET-3980]
This commit is contained in:
Rostislav Wolny
2021-12-01 14:07:09 +01:00
committed by Veljko V
parent 539f518f64
commit df6a955f0c
21 changed files with 84 additions and 67 deletions

View File

@@ -2,8 +2,11 @@
namespace MailPoet\Util\pQuery;
class DomNode extends \pQuery\DomNode {
public $childClass = 'MailPoet\Util\pQuery\DomNode';
use MailPoetVendor\pQuery\DomNode as pQueryDomNode;
class DomNode extends pQueryDomNode {
public $childClass = DomNode::class;
public $parserClass = Html5Parser::class;
public function getInnerText() {
return html_entity_decode($this->toString(true, true, 1), ENT_NOQUOTES, 'UTF-8');
@@ -12,4 +15,10 @@ class DomNode extends \pQuery\DomNode {
public function getOuterText() {
return html_entity_decode($this->toString(), ENT_NOQUOTES, 'UTF-8');
}
public function query($query = '*') {
$select = $this->select($query);
$result = new pQuery((array)$select);
return $result;
}
}