Skip to content

Commit 2024d46

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

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
@@ -42,9 +42,10 @@ public static function parse(ParserState $parserState, ?CSSList $list = null): ?
4242
try {
4343
$selectorParts = [];
4444
$stringWrapperCharacter = null;
45+
static $stopCharacters = ['{', '}', '\'', '"'];
4546
do {
4647
$selectorParts[] = $parserState->consume(1)
47-
. $parserState->consumeUntil(['{', '}', '\'', '"'], false, false, $comments);
48+
. $parserState->consumeUntil($stopCharacters, false, false, $comments);
4849
$nextCharacter = $parserState->peek();
4950
switch ($nextCharacter) {
5051
case '\'':

0 commit comments

Comments
 (0)