@@ -41,7 +41,7 @@ abstract class CSSList implements Renderable, Commentable
41
41
/**
42
42
* @var array<int, RuleSet|CSSList|Import|Charset>
43
43
*/
44
- protected $ aContents ;
44
+ protected $ contents ;
45
45
46
46
/**
47
47
* @var int
@@ -54,7 +54,7 @@ abstract class CSSList implements Renderable, Commentable
54
54
public function __construct ($ lineNumber = 0 )
55
55
{
56
56
$ this ->comments = [];
57
- $ this ->aContents = [];
57
+ $ this ->contents = [];
58
58
$ this ->lineNumber = $ lineNumber ;
59
59
}
60
60
@@ -259,21 +259,21 @@ public function getLineNo()
259
259
/**
260
260
* Prepends an item to the list of contents.
261
261
*
262
- * @param RuleSet|CSSList|Import|Charset $oItem
262
+ * @param RuleSet|CSSList|Import|Charset $item
263
263
*/
264
- public function prepend ($ oItem ): void
264
+ public function prepend ($ item ): void
265
265
{
266
- \array_unshift ($ this ->aContents , $ oItem );
266
+ \array_unshift ($ this ->contents , $ item );
267
267
}
268
268
269
269
/**
270
270
* Appends an item to the list of contents.
271
271
*
272
- * @param RuleSet|CSSList|Import|Charset $oItem
272
+ * @param RuleSet|CSSList|Import|Charset $item
273
273
*/
274
- public function append ($ oItem ): void
274
+ public function append ($ item ): void
275
275
{
276
- $ this ->aContents [] = $ oItem ;
276
+ $ this ->contents [] = $ item ;
277
277
}
278
278
279
279
/**
@@ -285,7 +285,7 @@ public function append($oItem): void
285
285
*/
286
286
public function splice ($ iOffset , $ iLength = null , $ mReplacement = null ): void
287
287
{
288
- \array_splice ($ this ->aContents , $ iOffset , $ iLength , $ mReplacement );
288
+ \array_splice ($ this ->contents , $ iOffset , $ iLength , $ mReplacement );
289
289
}
290
290
291
291
/**
@@ -297,7 +297,7 @@ public function splice($iOffset, $iLength = null, $mReplacement = null): void
297
297
*/
298
298
public function insertBefore ($ item , $ sibling ): void
299
299
{
300
- if (\in_array ($ sibling , $ this ->aContents , true )) {
300
+ if (\in_array ($ sibling , $ this ->contents , true )) {
301
301
$ this ->replace ($ sibling , [$ item , $ sibling ]);
302
302
} else {
303
303
$ this ->append ($ item );
@@ -307,17 +307,17 @@ public function insertBefore($item, $sibling): void
307
307
/**
308
308
* Removes an item from the CSS list.
309
309
*
310
- * @param RuleSet|Import|Charset|CSSList $oItemToRemove
310
+ * @param RuleSet|Import|Charset|CSSList $itemToRemove
311
311
* May be a `RuleSet` (most likely a `DeclarationBlock`), an `Import`,
312
312
* a `Charset` or another `CSSList` (most likely a `MediaQuery`)
313
313
*
314
314
* @return bool whether the item was removed
315
315
*/
316
- public function remove ($ oItemToRemove )
316
+ public function remove ($ itemToRemove )
317
317
{
318
- $ iKey = \array_search ($ oItemToRemove , $ this ->aContents , true );
318
+ $ iKey = \array_search ($ itemToRemove , $ this ->contents , true );
319
319
if ($ iKey !== false ) {
320
- unset($ this ->aContents [$ iKey ]);
320
+ unset($ this ->contents [$ iKey ]);
321
321
return true ;
322
322
}
323
323
return false ;
@@ -326,33 +326,33 @@ public function remove($oItemToRemove)
326
326
/**
327
327
* Replaces an item from the CSS list.
328
328
*
329
- * @param RuleSet|Import|Charset|CSSList $oOldItem
329
+ * @param RuleSet|Import|Charset|CSSList $oldItem
330
330
* May be a `RuleSet` (most likely a `DeclarationBlock`), an `Import`, a `Charset`
331
331
* or another `CSSList` (most likely a `MediaQuery`)
332
332
*
333
333
* @return bool
334
334
*/
335
- public function replace ($ oOldItem , $ mNewItem )
335
+ public function replace ($ oldItem , $ newItem )
336
336
{
337
- $ iKey = \array_search ($ oOldItem , $ this ->aContents , true );
337
+ $ iKey = \array_search ($ oldItem , $ this ->contents , true );
338
338
if ($ iKey !== false ) {
339
- if (\is_array ($ mNewItem )) {
340
- \array_splice ($ this ->aContents , $ iKey , 1 , $ mNewItem );
339
+ if (\is_array ($ newItem )) {
340
+ \array_splice ($ this ->contents , $ iKey , 1 , $ newItem );
341
341
} else {
342
- \array_splice ($ this ->aContents , $ iKey , 1 , [$ mNewItem ]);
342
+ \array_splice ($ this ->contents , $ iKey , 1 , [$ newItem ]);
343
343
}
344
344
return true ;
345
345
}
346
346
return false ;
347
347
}
348
348
349
349
/**
350
- * @param array<int, RuleSet|Import|Charset|CSSList> $aContents
350
+ * @param array<int, RuleSet|Import|Charset|CSSList> $contents
351
351
*/
352
- public function setContents (array $ aContents ): void
352
+ public function setContents (array $ contents ): void
353
353
{
354
- $ this ->aContents = [];
355
- foreach ($ aContents as $ content ) {
354
+ $ this ->contents = [];
355
+ foreach ($ contents as $ content ) {
356
356
$ this ->append ($ content );
357
357
}
358
358
}
@@ -383,12 +383,12 @@ public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false
383
383
$ mSel = new Selector ($ mSel );
384
384
}
385
385
}
386
- foreach ($ this ->aContents as $ iKey => $ mItem ) {
387
- if (!($ mItem instanceof DeclarationBlock)) {
386
+ foreach ($ this ->contents as $ iKey => $ item ) {
387
+ if (!($ item instanceof DeclarationBlock)) {
388
388
continue ;
389
389
}
390
- if ($ mItem ->getSelectors () == $ mSelector ) {
391
- unset($ this ->aContents [$ iKey ]);
390
+ if ($ item ->getSelectors () == $ mSelector ) {
391
+ unset($ this ->contents [$ iKey ]);
392
392
if (!$ bRemoveAll ) {
393
393
return ;
394
394
}
@@ -412,9 +412,9 @@ protected function renderListContents(OutputFormat $oOutputFormat)
412
412
if (!$ this ->isRootList ()) {
413
413
$ oNextLevel = $ oOutputFormat ->nextLevel ();
414
414
}
415
- foreach ($ this ->aContents as $ oContent ) {
416
- $ sRendered = $ oOutputFormat ->safely (static function () use ($ oNextLevel , $ oContent ): string {
417
- return $ oContent ->render ($ oNextLevel );
415
+ foreach ($ this ->contents as $ listItem ) {
416
+ $ sRendered = $ oOutputFormat ->safely (static function () use ($ oNextLevel , $ listItem ): string {
417
+ return $ listItem ->render ($ oNextLevel );
418
418
});
419
419
if ($ sRendered === null ) {
420
420
continue ;
@@ -450,7 +450,7 @@ abstract public function isRootList();
450
450
*/
451
451
public function getContents ()
452
452
{
453
- return $ this ->aContents ;
453
+ return $ this ->contents ;
454
454
}
455
455
456
456
/**
0 commit comments