@@ -95,18 +95,18 @@ public function colorParsing(): void
9595 $ selectors = $ declarationBlock ->getSelectors ();
9696 $ selector = $ selectors [0 ]->getSelector ();
9797 if ($ selector === '#mine ' ) {
98- $ colorRules = $ declarationBlock ->getRules ('color ' );
98+ $ colorRules = $ declarationBlock ->getDeclarations ('color ' );
9999 $ colorRuleValue = $ colorRules [0 ]->getValue ();
100100 self ::assertSame ('red ' , $ colorRuleValue );
101- $ colorRules = $ declarationBlock ->getRules ('background- ' );
101+ $ colorRules = $ declarationBlock ->getDeclarations ('background- ' );
102102 $ colorRuleValue = $ colorRules [0 ]->getValue ();
103103 self ::assertInstanceOf (Color::class, $ colorRuleValue );
104104 self ::assertEquals ([
105105 'r ' => new Size (35.0 , null , true , $ colorRuleValue ->getLineNumber ()),
106106 'g ' => new Size (35.0 , null , true , $ colorRuleValue ->getLineNumber ()),
107107 'b ' => new Size (35.0 , null , true , $ colorRuleValue ->getLineNumber ()),
108108 ], $ colorRuleValue ->getColor ());
109- $ colorRules = $ declarationBlock ->getRules ('border-color ' );
109+ $ colorRules = $ declarationBlock ->getDeclarations ('border-color ' );
110110 $ colorRuleValue = $ colorRules [0 ]->getValue ();
111111 self ::assertInstanceOf (Color::class, $ colorRuleValue );
112112 self ::assertEquals ([
@@ -122,7 +122,7 @@ public function colorParsing(): void
122122 'b ' => new Size (231.0 , null , true , $ colorRuleValue ->getLineNumber ()),
123123 'a ' => new Size ('0000.3 ' , null , true , $ colorRuleValue ->getLineNumber ()),
124124 ], $ colorRuleValue ->getColor ());
125- $ colorRules = $ declarationBlock ->getRules ('outline-color ' );
125+ $ colorRules = $ declarationBlock ->getDeclarations ('outline-color ' );
126126 $ colorRuleValue = $ colorRules [0 ]->getValue ();
127127 self ::assertInstanceOf (Color::class, $ colorRuleValue );
128128 self ::assertEquals ([
@@ -131,7 +131,7 @@ public function colorParsing(): void
131131 'b ' => new Size (34.0 , null , true , $ colorRuleValue ->getLineNumber ()),
132132 ], $ colorRuleValue ->getColor ());
133133 } elseif ($ selector === '#yours ' ) {
134- $ colorRules = $ declarationBlock ->getRules ('background-color ' );
134+ $ colorRules = $ declarationBlock ->getDeclarations ('background-color ' );
135135 $ colorRuleValue = $ colorRules [0 ]->getValue ();
136136 self ::assertInstanceOf (Color::class, $ colorRuleValue );
137137 self ::assertEquals ([
@@ -147,7 +147,7 @@ public function colorParsing(): void
147147 'l ' => new Size (220.0 , '% ' , true , $ colorRuleValue ->getLineNumber ()),
148148 'a ' => new Size (0000.3 , null , true , $ colorRuleValue ->getLineNumber ()),
149149 ], $ colorRuleValue ->getColor ());
150- $ colorRules = $ declarationBlock ->getRules ('outline-color ' );
150+ $ colorRules = $ declarationBlock ->getDeclarations ('outline-color ' );
151151 self ::assertEmpty ($ colorRules );
152152 }
153153 }
@@ -179,7 +179,7 @@ public function unicodeParsing(): void
179179 if (\substr ($ selector , 0 , \strlen ('.test- ' )) !== '.test- ' ) {
180180 continue ;
181181 }
182- $ contentRules = $ declarationBlock ->getRules ('content ' );
182+ $ contentRules = $ declarationBlock ->getDeclarations ('content ' );
183183 $ firstContentRuleAsString = $ contentRules [0 ]->getValue ()->render (OutputFormat::create ());
184184 if ($ selector === '.test-1 ' ) {
185185 self ::assertSame ('" " ' , $ firstContentRuleAsString );
@@ -315,7 +315,7 @@ public function manipulation(): void
315315 $ document ->render ()
316316 );
317317 foreach ($ document ->getAllRuleSets () as $ ruleSet ) {
318- $ ruleSet ->removeMatchingRules ('font- ' );
318+ $ ruleSet ->removeMatchingDeclarations ('font- ' );
319319 }
320320 self ::assertSame (
321321 '#header {margin: 10px 2em 1cm 2%;color: red !important;background-color: green; '
@@ -324,7 +324,7 @@ public function manipulation(): void
324324 $ document ->render ()
325325 );
326326 foreach ($ document ->getAllRuleSets () as $ ruleSet ) {
327- $ ruleSet ->removeMatchingRules ('background- ' );
327+ $ ruleSet ->removeMatchingDeclarations ('background- ' );
328328 }
329329 self ::assertSame (
330330 '#header {margin: 10px 2em 1cm 2%;color: red !important;frequency: 30Hz;transform: rotate(1turn);}
@@ -342,16 +342,16 @@ public function ruleGetters(): void
342342 $ declarationBlocks = $ document ->getAllDeclarationBlocks ();
343343 $ headerBlock = $ declarationBlocks [0 ];
344344 $ bodyBlock = $ declarationBlocks [1 ];
345- $ backgroundHeaderRules = $ headerBlock ->getRules ('background- ' );
345+ $ backgroundHeaderRules = $ headerBlock ->getDeclarations ('background- ' );
346346 self ::assertCount (2 , $ backgroundHeaderRules );
347347 self ::assertSame ('background-color ' , $ backgroundHeaderRules [0 ]->getPropertyName ());
348348 self ::assertSame ('background-color ' , $ backgroundHeaderRules [1 ]->getPropertyName ());
349- $ backgroundHeaderRules = $ headerBlock ->getRulesAssoc ('background- ' );
349+ $ backgroundHeaderRules = $ headerBlock ->getDeclarationsAssociative ('background- ' );
350350 self ::assertCount (1 , $ backgroundHeaderRules );
351351 self ::assertInstanceOf (Color::class, $ backgroundHeaderRules ['background-color ' ]->getValue ());
352352 self ::assertSame ('rgba ' , $ backgroundHeaderRules ['background-color ' ]->getValue ()->getColorDescription ());
353- $ headerBlock ->removeRule ($ backgroundHeaderRules ['background-color ' ]);
354- $ backgroundHeaderRules = $ headerBlock ->getRules ('background- ' );
353+ $ headerBlock ->removeDeclaration ($ backgroundHeaderRules ['background-color ' ]);
354+ $ backgroundHeaderRules = $ headerBlock ->getDeclarations ('background- ' );
355355 self ::assertCount (1 , $ backgroundHeaderRules );
356356 self ::assertSame ('green ' , $ backgroundHeaderRules [0 ]->getValue ());
357357 }
@@ -372,7 +372,7 @@ public function slashedValues(): void
372372 }
373373 }
374374 foreach ($ document ->getAllDeclarationBlocks () as $ declarationBlock ) {
375- $ fontRules = $ declarationBlock ->getRules ('font ' );
375+ $ fontRules = $ declarationBlock ->getDeclarations ('font ' );
376376 $ fontRule = $ fontRules [0 ];
377377 $ fontRuleValue = $ fontRule ->getValue ();
378378 self ::assertSame (' ' , $ fontRuleValue ->getListSeparator ());
@@ -383,7 +383,7 @@ public function slashedValues(): void
383383 self ::assertInstanceOf (ValueList::class, $ slashList );
384384 self ::assertSame (', ' , $ commaList ->getListSeparator ());
385385 self ::assertSame ('/ ' , $ slashList ->getListSeparator ());
386- $ borderRadiusRules = $ declarationBlock ->getRules ('border-radius ' );
386+ $ borderRadiusRules = $ declarationBlock ->getDeclarations ('border-radius ' );
387387 $ borderRadiusRule = $ borderRadiusRules [0 ];
388388 $ slashList = $ borderRadiusRule ->getValue ();
389389 self ::assertSame ('/ ' , $ slashList ->getListSeparator ());
@@ -883,7 +883,7 @@ public function missingPropertyValueLenient(): void
883883 $ block = $ declarationBlocks [0 ];
884884 self ::assertInstanceOf (DeclarationBlock::class, $ block );
885885 self ::assertEquals ([new Selector ('div ' )], $ block ->getSelectors ());
886- $ rules = $ block ->getRules ();
886+ $ rules = $ block ->getDeclarations ();
887887 self ::assertCount (1 , $ rules );
888888 $ rule = $ rules [0 ];
889889 self ::assertSame ('display ' , $ rule ->getPropertyName ());
@@ -948,7 +948,7 @@ public function lineNumbersParsing(): void
948948 $ declarationBlocks = $ document ->getAllDeclarationBlocks ();
949949 // Choose the 2nd one
950950 $ secondDeclarationBlock = $ declarationBlocks [1 ];
951- $ rules = $ secondDeclarationBlock ->getRules ();
951+ $ rules = $ secondDeclarationBlock ->getDeclarations ();
952952 // Choose the 2nd one
953953 $ valueOfSecondRule = $ rules [1 ]->getValue ();
954954 self ::assertInstanceOf (Color::class, $ valueOfSecondRule );
@@ -1007,7 +1007,7 @@ public function commentExtracting(): void
10071007
10081008 // Declaration rules.
10091009 self ::assertInstanceOf (DeclarationBlock::class, $ fooBarBlock );
1010- $ fooBarRules = $ fooBarBlock ->getRules ();
1010+ $ fooBarRules = $ fooBarBlock ->getDeclarations ();
10111011 $ fooBarRule = $ fooBarRules [0 ];
10121012 $ fooBarRuleComments = $ fooBarRule ->getComments ();
10131013 self ::assertCount (1 , $ fooBarRuleComments );
@@ -1028,7 +1028,7 @@ public function commentExtracting(): void
10281028
10291029 // Media -> declaration -> rule.
10301030 self ::assertInstanceOf (DeclarationBlock::class, $ mediaRules [0 ]);
1031- $ fooBarRules = $ mediaRules [0 ]->getRules ();
1031+ $ fooBarRules = $ mediaRules [0 ]->getDeclarations ();
10321032 $ fooBarChildComments = $ fooBarRules [0 ]->getComments ();
10331033 self ::assertCount (1 , $ fooBarChildComments );
10341034 self ::assertSame ('* Number 10b * ' , $ fooBarChildComments [0 ]->getComment ());
@@ -1044,7 +1044,7 @@ public function flatCommentExtractingOneComment(): void
10441044
10451045 $ contents = $ document ->getContents ();
10461046 self ::assertInstanceOf (DeclarationBlock::class, $ contents [0 ]);
1047- $ divRules = $ contents [0 ]->getRules ();
1047+ $ divRules = $ contents [0 ]->getDeclarations ();
10481048 $ comments = $ divRules [0 ]->getComments ();
10491049
10501050 self ::assertCount (1 , $ comments );
@@ -1061,7 +1061,7 @@ public function flatCommentExtractingTwoConjoinedCommentsForOneRule(): void
10611061
10621062 $ contents = $ document ->getContents ();
10631063 self ::assertInstanceOf (DeclarationBlock::class, $ contents [0 ]);
1064- $ divRules = $ contents [0 ]->getRules ();
1064+ $ divRules = $ contents [0 ]->getDeclarations ();
10651065 $ comments = $ divRules [0 ]->getComments ();
10661066
10671067 self ::assertCount (2 , $ comments );
@@ -1079,7 +1079,7 @@ public function flatCommentExtractingTwoSpaceSeparatedCommentsForOneRule(): void
10791079
10801080 $ contents = $ document ->getContents ();
10811081 self ::assertInstanceOf (DeclarationBlock::class, $ contents [0 ]);
1082- $ divRules = $ contents [0 ]->getRules ();
1082+ $ divRules = $ contents [0 ]->getDeclarations ();
10831083 $ comments = $ divRules [0 ]->getComments ();
10841084
10851085 self ::assertCount (2 , $ comments );
@@ -1097,7 +1097,7 @@ public function flatCommentExtractingCommentsForTwoRules(): void
10971097
10981098 $ contents = $ document ->getContents ();
10991099 self ::assertInstanceOf (DeclarationBlock::class, $ contents [0 ]);
1100- $ divRules = $ contents [0 ]->getRules ();
1100+ $ divRules = $ contents [0 ]->getDeclarations ();
11011101 $ rule1Comments = $ divRules [0 ]->getComments ();
11021102 $ rule2Comments = $ divRules [1 ]->getComments ();
11031103
@@ -1182,7 +1182,7 @@ public function escapedSpecialCaseTokens(): void
11821182 $ document = self ::parsedStructureForFile ('escaped-tokens ' );
11831183 $ contents = $ document ->getContents ();
11841184 self ::assertInstanceOf (RuleSet::class, $ contents [0 ]);
1185- $ rules = $ contents [0 ]->getRules ();
1185+ $ rules = $ contents [0 ]->getDeclarations ();
11861186 $ urlRule = $ rules [0 ];
11871187 $ calcRule = $ rules [1 ];
11881188 self ::assertInstanceOf (URL ::class, $ urlRule ->getValue ());
0 commit comments