Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Parser.php

function Parser::__construct

Same name in this branch
  1. 11.1.x vendor/open-telemetry/api/Baggage/Propagation/Parser.php \OpenTelemetry\API\Baggage\Propagation\Parser::__construct()
  2. 11.1.x vendor/egulias/email-validator/src/Parser.php \Egulias\EmailValidator\Parser::__construct()
  3. 11.1.x vendor/twig/twig/src/Parser.php \Twig\Parser::__construct()
  4. 11.1.x vendor/symfony/css-selector/Parser/Parser.php \Symfony\Component\CssSelector\Parser\Parser::__construct()

Class constructor

Parameters

string $selector Selector string:

array $options Options array. See Query class: documentation for available options

File

vendor/mck89/peast/lib/Peast/Selector/Parser.php, line 89

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

public function __construct($selector, $options = array()) {
    $encoding = isset($options["encoding"]) ? $options["encoding"] : null;
    if ($encoding && !preg_match("/UTF-?8/i", $encoding)) {
        $selector = mb_convert_encoding($selector, "UTF-8", $encoding);
    }
    $this->selector = $selector;
    $this->length = strlen($selector);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal