From 380c9b29d861def4502f6ce1caec9e8197aa1d18 Mon Sep 17 00:00:00 2001 From: Jake Hotson Date: Sat, 28 Feb 2026 19:29:47 +0000 Subject: [PATCH] [CLEANUP] Change `AtRule::BLOCK_RULES` to an array --- src/CSSList/CSSList.php | 2 +- src/Property/AtRule.php | 13 +++++++++++-- tests/Unit/Property/AtRuleTest.php | 2 +- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/CSSList/CSSList.php b/src/CSSList/CSSList.php index 62f7fe65..77af0c81 100644 --- a/src/CSSList/CSSList.php +++ b/src/CSSList/CSSList.php @@ -222,7 +222,7 @@ private static function parseAtRule(ParserState $parserState): ?CSSListItem } } $useRuleSet = true; - foreach (\explode('/', AtRule::BLOCK_RULES) as $blockRuleName) { + foreach (AtRule::BLOCK_RULES as $blockRuleName) { if (self::identifierIs($identifier, $blockRuleName)) { $useRuleSet = false; break; diff --git a/src/Property/AtRule.php b/src/Property/AtRule.php index 3ba6236a..808df79f 100644 --- a/src/Property/AtRule.php +++ b/src/Property/AtRule.php @@ -18,8 +18,17 @@ interface AtRule extends CSSListItem * * @internal since 8.5.2 */ - public const BLOCK_RULES = - 'media/document/supports/region-style/font-feature-values/container/layer/scope/starting-style'; + public const BLOCK_RULES = [ + 'media', + 'document', + 'supports', + 'region-style', + 'font-feature-values', + 'container', + 'layer', + 'scope', + 'starting-style', + ]; /** * @return non-empty-string diff --git a/tests/Unit/Property/AtRuleTest.php b/tests/Unit/Property/AtRuleTest.php index 526bb312..85407745 100644 --- a/tests/Unit/Property/AtRuleTest.php +++ b/tests/Unit/Property/AtRuleTest.php @@ -29,7 +29,7 @@ public function blockRulesConstantIsCorrect(): void 'scope', 'starting-style', ], - explode('/', AtRule::BLOCK_RULES) + AtRule::BLOCK_RULES ); } }