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

Breadcrumb

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

function Parser::consumeAny

Consumes the given characters

Parameters

array $chars Characters to consume:

false $stopAtFirst If true only the first matching character: is consumed

Return value

string

4 calls to Parser::consumeAny()
Parser::consumeCombinator in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Consumes a combinator
Parser::consumeWhitespaces in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Consumes as much whitespaces as possible
Parser::parseLiteralString in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses a literal string
Parser::parseSelectorPartAttribute in vendor/mck89/peast/lib/Peast/Selector/Parser.php
Parses an attribute selector part

File

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

Class

Parser
Selector parser class

Namespace

Peast\Selector

Code

protected function consumeAny($chars, $stopAtFirst = false) {
    $buffer = "";
    while (($char = $this->getChar()) !== null) {
        if (in_array($char, $chars)) {
            $buffer .= $char;
            $this->index++;
            if ($stopAtFirst) {
                break;
            }
        }
        else {
            break;
        }
    }
    return $buffer;
}

API Navigation

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