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,13 +2,15 @@
namespace MailPoet\Util\pQuery;
use MailPoetVendor\pQuery\pQuery as pQuerypQuery;
// extend pQuery class to use UTF-8 encoding when getting elements' inner/outer text
// phpcs:ignore Squiz.Classes.ValidClassName
class pQuery extends \pQuery {
public static function parseStr($html) {
class pQuery extends pQuerypQuery {
public static function parseStr($html): DomNode {
$parser = new Html5Parser($html);
if (!$parser->root instanceof \pQuery\DomNode) {
if (!$parser->root instanceof DomNode) {
// this condition shouldn't happen it is here only for PHPStan
throw new \Exception('Renderer is not configured correctly');
}