2121abstract class CSSBlockList extends CSSList
2222{
2323 /**
24- * @param int $iLineNo
24+ * @param int $lineNumber
2525 */
26- public function __construct ($ iLineNo = 0 )
26+ public function __construct ($ lineNumber = 0 )
2727 {
28- parent ::__construct ($ iLineNo );
28+ parent ::__construct ($ lineNumber );
2929 }
3030
3131 /**
32- * @param array<int, DeclarationBlock> $aResult
32+ * @param array<int, DeclarationBlock> $result
3333 */
34- protected function allDeclarationBlocks (array &$ aResult ): void
34+ protected function allDeclarationBlocks (array &$ result ): void
3535 {
3636 foreach ($ this ->aContents as $ mContent ) {
3737 if ($ mContent instanceof DeclarationBlock) {
38- $ aResult [] = $ mContent ;
38+ $ result [] = $ mContent ;
3939 } elseif ($ mContent instanceof CSSBlockList) {
40- $ mContent ->allDeclarationBlocks ($ aResult );
40+ $ mContent ->allDeclarationBlocks ($ result );
4141 }
4242 }
4343 }
4444
4545 /**
46- * @param array<int, RuleSet> $aResult
46+ * @param array<int, RuleSet> $result
4747 */
48- protected function allRuleSets (array &$ aResult ): void
48+ protected function allRuleSets (array &$ result ): void
4949 {
5050 foreach ($ this ->aContents as $ mContent ) {
5151 if ($ mContent instanceof RuleSet) {
52- $ aResult [] = $ mContent ;
52+ $ result [] = $ mContent ;
5353 } elseif ($ mContent instanceof CSSBlockList) {
54- $ mContent ->allRuleSets ($ aResult );
54+ $ mContent ->allRuleSets ($ result );
5555 }
5656 }
5757 }
5858
5959 /**
60- * @param CSSList|Rule|RuleSet|Value $oElement
61- * @param array<int, Value> $aResult
62- * @param string|null $sSearchString
63- * @param bool $bSearchInFunctionArguments
60+ * @param CSSList|Rule|RuleSet|Value $element
61+ * @param array<int, Value> $result
62+ * @param string|null $searchString
63+ * @param bool $searchInFunctionArguments
6464 */
6565 protected function allValues (
66- $ oElement ,
67- array &$ aResult ,
68- $ sSearchString = null ,
69- $ bSearchInFunctionArguments = false
66+ $ element ,
67+ array &$ result ,
68+ $ searchString = null ,
69+ $ searchInFunctionArguments = false
7070 ): void {
71- if ($ oElement instanceof CSSBlockList) {
72- foreach ($ oElement ->getContents () as $ oContent ) {
73- $ this ->allValues ($ oContent , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
71+ if ($ element instanceof CSSBlockList) {
72+ foreach ($ element ->getContents () as $ oContent ) {
73+ $ this ->allValues ($ oContent , $ result , $ searchString , $ searchInFunctionArguments );
7474 }
75- } elseif ($ oElement instanceof RuleSet) {
76- foreach ($ oElement ->getRules ($ sSearchString ) as $ oRule ) {
77- $ this ->allValues ($ oRule , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
75+ } elseif ($ element instanceof RuleSet) {
76+ foreach ($ element ->getRules ($ searchString ) as $ oRule ) {
77+ $ this ->allValues ($ oRule , $ result , $ searchString , $ searchInFunctionArguments );
7878 }
79- } elseif ($ oElement instanceof Rule) {
80- $ this ->allValues ($ oElement ->getValue (), $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
81- } elseif ($ oElement instanceof ValueList) {
82- if ($ bSearchInFunctionArguments || !($ oElement instanceof CSSFunction)) {
83- foreach ($ oElement ->getListComponents () as $ mComponent ) {
84- $ this ->allValues ($ mComponent , $ aResult , $ sSearchString , $ bSearchInFunctionArguments );
79+ } elseif ($ element instanceof Rule) {
80+ $ this ->allValues ($ element ->getValue (), $ result , $ searchString , $ searchInFunctionArguments );
81+ } elseif ($ element instanceof ValueList) {
82+ if ($ searchInFunctionArguments || !($ element instanceof CSSFunction)) {
83+ foreach ($ element ->getListComponents () as $ mComponent ) {
84+ $ this ->allValues ($ mComponent , $ result , $ searchString , $ searchInFunctionArguments );
8585 }
8686 }
8787 } else {
8888 // Non-List `Value` or `CSSString` (CSS identifier)
89- $ aResult [] = $ oElement ;
89+ $ result [] = $ element ;
9090 }
9191 }
9292
9393 /**
94- * @param array<int, Selector> $aResult
95- * @param string|null $sSpecificitySearch
94+ * @param array<int, Selector> $result
95+ * @param string|null $specificitySearch
9696 */
97- protected function allSelectors (array &$ aResult , $ sSpecificitySearch = null ): void
97+ protected function allSelectors (array &$ result , $ specificitySearch = null ): void
9898 {
9999 /** @var array<int, DeclarationBlock> $aDeclarationBlocks */
100100 $ aDeclarationBlocks = [];
101101 $ this ->allDeclarationBlocks ($ aDeclarationBlocks );
102102 foreach ($ aDeclarationBlocks as $ oBlock ) {
103103 foreach ($ oBlock ->getSelectors () as $ oSelector ) {
104- if ($ sSpecificitySearch === null ) {
105- $ aResult [] = $ oSelector ;
104+ if ($ specificitySearch === null ) {
105+ $ result [] = $ oSelector ;
106106 } else {
107107 $ sComparator = '=== ' ;
108- $ aSpecificitySearch = \explode (' ' , $ sSpecificitySearch );
108+ $ aSpecificitySearch = \explode (' ' , $ specificitySearch );
109109 $ iTargetSpecificity = $ aSpecificitySearch [0 ];
110110 if (\count ($ aSpecificitySearch ) > 1 ) {
111111 $ sComparator = $ aSpecificitySearch [0 ];
112112 $ iTargetSpecificity = $ aSpecificitySearch [1 ];
113113 }
114- $ iTargetSpecificity = (int ) $ iTargetSpecificity ;
114+ $ iTargetSpecificity = (int )$ iTargetSpecificity ;
115115 $ iSelectorSpecificity = $ oSelector ->getSpecificity ();
116116 $ bMatches = false ;
117117 switch ($ sComparator ) {
@@ -132,7 +132,7 @@ protected function allSelectors(array &$aResult, $sSpecificitySearch = null): vo
132132 break ;
133133 }
134134 if ($ bMatches ) {
135- $ aResult [] = $ oSelector ;
135+ $ result [] = $ oSelector ;
136136 }
137137 }
138138 }
0 commit comments