Check type for PHPStan
[MAILPOET-2535]
This commit is contained in:
committed by
Jack Kitterhing
parent
86f700b84c
commit
672b0c272e
@@ -6,6 +6,12 @@ namespace MailPoet\Util\pQuery;
|
|||||||
class pQuery extends \pQuery {
|
class pQuery extends \pQuery {
|
||||||
public static function parseStr($html) {
|
public static function parseStr($html) {
|
||||||
$parser = new Html5Parser($html);
|
$parser = new Html5Parser($html);
|
||||||
|
|
||||||
|
if (!$parser->root instanceof \pQuery\DomNode) {
|
||||||
|
// this condition shouldn't happen it is here only for PHPStan
|
||||||
|
throw new \Exception('Renderer is not configured correctly');
|
||||||
|
}
|
||||||
|
|
||||||
return $parser->root;
|
return $parser->root;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user