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\SelectorCode
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;
}