From 2024d46ac0ea68cd3d2d17400e266cda3fd02fea Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Wed, 9 Jul 2025 19:05:39 +0100 Subject: [PATCH] [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.) --- src/RuleSet/DeclarationBlock.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/RuleSet/DeclarationBlock.php b/src/RuleSet/DeclarationBlock.php index 314bbae3d..bd295dd21 100644 --- a/src/RuleSet/DeclarationBlock.php +++ b/src/RuleSet/DeclarationBlock.php @@ -42,9 +42,10 @@ public static function parse(ParserState $parserState, ?CSSList $list = null): ? try { $selectorParts = []; $stringWrapperCharacter = null; + static $stopCharacters = ['{', '}', '\'', '"']; do { $selectorParts[] = $parserState->consume(1) - . $parserState->consumeUntil(['{', '}', '\'', '"'], false, false, $comments); + . $parserState->consumeUntil($stopCharacters, false, false, $comments); $nextCharacter = $parserState->peek(); switch ($nextCharacter) { case '\'':