Check type for PHPStan

[MAILPOET-2535]
This commit is contained in:
Pavel Dohnal
2019-11-19 12:55:12 +01:00
committed by Jack Kitterhing
parent 86f700b84c
commit 672b0c272e

View File

@@ -6,6 +6,12 @@ namespace MailPoet\Util\pQuery;
class pQuery extends \pQuery {
public static function parseStr($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;
}
}