Skip to content

Commit 7bd3fb2

Browse files
committed
[CLEANUP] Use static variable for stop characters (#1321)
... in `DeclarationBlock::parse()`. This improves readability in preparation for #1292 which will extend the list. (It may also slightly improve performance.)
1 parent d0a82a6 commit 7bd3fb2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/RuleSet/DeclarationBlock.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ public static function parse(ParserState $oParserState, $oList = null)
5959
try {
6060
$selectorParts = [];
6161
$stringWrapperCharacter = null;
62+
static $stopCharacters = ['{', '}', '\'', '"'];
6263
do {
6364
$selectorParts[] = $oParserState->consume(1)
64-
. $oParserState->consumeUntil(['{', '}', '\'', '"'], false, false, $aComments);
65+
. $oParserState->consumeUntil($stopCharacters, false, false, $aComments);
6566
$nextCharacter = $oParserState->peek();
6667
switch ($nextCharacter) {
6768
case '\'':

0 commit comments

Comments
 (0)