Fix deprecation warnings coming from pQuery library
[MAILPOET-3980]
This commit is contained in:
committed by
Veljko V
parent
539f518f64
commit
df6a955f0c
@@ -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');
|
||||
}
|
||||
|
Reference in New Issue
Block a user