Нет описания

pQuery.php 545B

12345678910111213141516171819202122
  1. <?php
  2. namespace MailPoet\Util\pQuery;
  3. if (!defined('ABSPATH')) exit;
  4. // extend pQuery class to use UTF-8 encoding when getting elements' inner/outer text
  5. // phpcs:ignore Squiz.Classes.ValidClassName
  6. class pQuery extends \pQuery {
  7. public static function parseStr($html) {
  8. $parser = new Html5Parser($html);
  9. if (!$parser->root instanceof \pQuery\DomNode) {
  10. // this condition shouldn't happen it is here only for PHPStan
  11. throw new \Exception('Renderer is not configured correctly');
  12. }
  13. return $parser->root;
  14. }
  15. }