@@ -27,7 +27,7 @@ class DeclarationBlock extends RuleSet
27
27
/**
28
28
* @var array<int, Selector|string>
29
29
*/
30
- private $ aSelectors = [];
30
+ private $ selectors = [];
31
31
32
32
/**
33
33
* @param CSSList|null $list
@@ -76,38 +76,38 @@ public static function parse(ParserState $parserState, $list = null)
76
76
}
77
77
78
78
/**
79
- * @param array<int, Selector|string>|string $mSelector
79
+ * @param array<int, Selector|string>|string $selector
80
80
* @param CSSList|null $list
81
81
*
82
82
* @throws UnexpectedTokenException
83
83
*/
84
- public function setSelectors ($ mSelector , $ list = null ): void
84
+ public function setSelectors ($ selector , $ list = null ): void
85
85
{
86
- if (\is_array ($ mSelector )) {
87
- $ this ->aSelectors = $ mSelector ;
86
+ if (\is_array ($ selector )) {
87
+ $ this ->selectors = $ selector ;
88
88
} else {
89
- $ this ->aSelectors = \explode (', ' , $ mSelector );
89
+ $ this ->selectors = \explode (', ' , $ selector );
90
90
}
91
- foreach ($ this ->aSelectors as $ key => $ mSelector ) {
92
- if (!($ mSelector instanceof Selector)) {
91
+ foreach ($ this ->selectors as $ key => $ selector ) {
92
+ if (!($ selector instanceof Selector)) {
93
93
if ($ list === null || !($ list instanceof KeyFrame)) {
94
- if (!Selector::isValid ($ mSelector )) {
94
+ if (!Selector::isValid ($ selector )) {
95
95
throw new UnexpectedTokenException (
96
96
"Selector did not match ' " . Selector::SELECTOR_VALIDATION_RX . "'. " ,
97
- $ mSelector ,
97
+ $ selector ,
98
98
'custom '
99
99
);
100
100
}
101
- $ this ->aSelectors [$ key ] = new Selector ($ mSelector );
101
+ $ this ->selectors [$ key ] = new Selector ($ selector );
102
102
} else {
103
- if (!KeyframeSelector::isValid ($ mSelector )) {
103
+ if (!KeyframeSelector::isValid ($ selector )) {
104
104
throw new UnexpectedTokenException (
105
105
"Selector did not match ' " . KeyframeSelector::SELECTOR_VALIDATION_RX . "'. " ,
106
- $ mSelector ,
106
+ $ selector ,
107
107
'custom '
108
108
);
109
109
}
110
- $ this ->aSelectors [$ key ] = new KeyframeSelector ($ mSelector );
110
+ $ this ->selectors [$ key ] = new KeyframeSelector ($ selector );
111
111
}
112
112
}
113
113
}
@@ -116,16 +116,16 @@ public function setSelectors($mSelector, $list = null): void
116
116
/**
117
117
* Remove one of the selectors of the block.
118
118
*
119
- * @param Selector|string $mSelector
119
+ * @param Selector|string $selector
120
120
*/
121
- public function removeSelector ($ mSelector ): bool
121
+ public function removeSelector ($ selector ): bool
122
122
{
123
- if ($ mSelector instanceof Selector) {
124
- $ mSelector = $ mSelector ->getSelector ();
123
+ if ($ selector instanceof Selector) {
124
+ $ selector = $ selector ->getSelector ();
125
125
}
126
- foreach ($ this ->aSelectors as $ key => $ selector ) {
127
- if ($ selector ->getSelector () === $ mSelector ) {
128
- unset($ this ->aSelectors [$ key ]);
126
+ foreach ($ this ->selectors as $ key => $ subSelector ) {
127
+ if ($ subSelector ->getSelector () === $ selector ) {
128
+ unset($ this ->selectors [$ key ]);
129
129
return true ;
130
130
}
131
131
}
@@ -137,7 +137,7 @@ public function removeSelector($mSelector): bool
137
137
*/
138
138
public function getSelectors ()
139
139
{
140
- return $ this ->aSelectors ;
140
+ return $ this ->selectors ;
141
141
}
142
142
143
143
/**
@@ -154,14 +154,14 @@ public function __toString(): string
154
154
public function render (OutputFormat $ outputFormat ): string
155
155
{
156
156
$ result = $ outputFormat ->comments ($ this );
157
- if (\count ($ this ->aSelectors ) === 0 ) {
157
+ if (\count ($ this ->selectors ) === 0 ) {
158
158
// If all the selectors have been removed, this declaration block becomes invalid
159
159
throw new OutputException ('Attempt to print declaration block with missing selector ' , $ this ->lineNumber );
160
160
}
161
161
$ result .= $ outputFormat ->sBeforeDeclarationBlock ;
162
162
$ result .= $ outputFormat ->implode (
163
163
$ outputFormat ->spaceBeforeSelectorSeparator () . ', ' . $ outputFormat ->spaceAfterSelectorSeparator (),
164
- $ this ->aSelectors
164
+ $ this ->selectors
165
165
);
166
166
$ result .= $ outputFormat ->sAfterDeclarationBlockSelectors ;
167
167
$ result .= $ outputFormat ->spaceBeforeOpeningBrace () . '{ ' ;
0 commit comments