@@ -63,13 +63,13 @@ public function __construct($iLineNo = 0)
63
63
public static function parseList (ParserState $ oParserState , CSSList $ oList ): void
64
64
{
65
65
$ bIsRoot = $ oList instanceof Document;
66
- if (is_string ($ oParserState )) {
66
+ if (\ is_string ($ oParserState )) {
67
67
$ oParserState = new ParserState ($ oParserState , Settings::create ());
68
68
}
69
69
$ bLenientParsing = $ oParserState ->getSettings ()->bLenientParsing ;
70
70
$ aComments = [];
71
71
while (!$ oParserState ->isEnd ()) {
72
- $ aComments = array_merge ($ aComments , $ oParserState ->consumeWhiteSpace ());
72
+ $ aComments = \ array_merge ($ aComments , $ oParserState ->consumeWhiteSpace ());
73
73
$ oListItem = null ;
74
74
if ($ bLenientParsing ) {
75
75
try {
@@ -117,7 +117,7 @@ private static function parseListItem(ParserState $oParserState, CSSList $oList)
117
117
$ oParserState ->currentLine ()
118
118
);
119
119
}
120
- if (count ($ oList ->getContents ()) > 0 ) {
120
+ if (\ count ($ oList ->getContents ()) > 0 ) {
121
121
throw new UnexpectedTokenException (
122
122
'@charset must be the first parseable token in a document ' ,
123
123
'' ,
@@ -164,7 +164,7 @@ private static function parseAtRule(ParserState $oParserState)
164
164
$ oParserState ->consumeWhiteSpace ();
165
165
$ sMediaQuery = null ;
166
166
if (!$ oParserState ->comes ('; ' )) {
167
- $ sMediaQuery = trim ($ oParserState ->consumeUntil (['; ' , ParserState::EOF ]));
167
+ $ sMediaQuery = \ trim ($ oParserState ->consumeUntil (['; ' , ParserState::EOF ]));
168
168
}
169
169
$ oParserState ->consumeUntil (['; ' , ParserState::EOF ], true , true );
170
170
return new Import ($ oLocation , $ sMediaQuery ?: null , $ iIdentifierLineNum );
@@ -176,7 +176,7 @@ private static function parseAtRule(ParserState $oParserState)
176
176
} elseif (self ::identifierIs ($ sIdentifier , 'keyframes ' )) {
177
177
$ oResult = new KeyFrame ($ iIdentifierLineNum );
178
178
$ oResult ->setVendorKeyFrame ($ sIdentifier );
179
- $ oResult ->setAnimationName (trim ($ oParserState ->consumeUntil ('{ ' , false , true )));
179
+ $ oResult ->setAnimationName (\ trim ($ oParserState ->consumeUntil ('{ ' , false , true )));
180
180
CSSList::parseList ($ oParserState , $ oResult );
181
181
if ($ oParserState ->comes ('} ' )) {
182
182
$ oParserState ->consume ('} ' );
@@ -190,7 +190,7 @@ private static function parseAtRule(ParserState $oParserState)
190
190
$ mUrl = Value::parsePrimitiveValue ($ oParserState );
191
191
}
192
192
$ oParserState ->consumeUntil (['; ' , ParserState::EOF ], true , true );
193
- if ($ sPrefix !== null && !is_string ($ sPrefix )) {
193
+ if ($ sPrefix !== null && !\ is_string ($ sPrefix )) {
194
194
throw new UnexpectedTokenException ('Wrong namespace prefix ' , $ sPrefix , 'custom ' , $ iIdentifierLineNum );
195
195
}
196
196
if (!($ mUrl instanceof CSSString || $ mUrl instanceof URL )) {
@@ -204,16 +204,16 @@ private static function parseAtRule(ParserState $oParserState)
204
204
return new CSSNamespace ($ mUrl , $ sPrefix , $ iIdentifierLineNum );
205
205
} else {
206
206
// Unknown other at rule (font-face or such)
207
- $ sArgs = trim ($ oParserState ->consumeUntil ('{ ' , false , true ));
208
- if (substr_count ($ sArgs , "( " ) != substr_count ($ sArgs , ") " )) {
207
+ $ sArgs = \ trim ($ oParserState ->consumeUntil ('{ ' , false , true ));
208
+ if (\ substr_count ($ sArgs , "( " ) != \ substr_count ($ sArgs , ") " )) {
209
209
if ($ oParserState ->getSettings ()->bLenientParsing ) {
210
210
return null ;
211
211
} else {
212
212
throw new SourceException ("Unmatched brace count in media query " , $ oParserState ->currentLine ());
213
213
}
214
214
}
215
215
$ bUseRuleSet = true ;
216
- foreach (explode ('/ ' , AtRule::BLOCK_RULES ) as $ sBlockRuleName ) {
216
+ foreach (\ explode ('/ ' , AtRule::BLOCK_RULES ) as $ sBlockRuleName ) {
217
217
if (self ::identifierIs ($ sIdentifier , $ sBlockRuleName )) {
218
218
$ bUseRuleSet = false ;
219
219
break ;
@@ -242,8 +242,8 @@ private static function parseAtRule(ParserState $oParserState)
242
242
*/
243
243
private static function identifierIs ($ sIdentifier , $ sMatch ): bool
244
244
{
245
- return (strcasecmp ($ sIdentifier , $ sMatch ) === 0 )
246
- ?: preg_match ("/^(- \\w+-)? $ sMatch$/i " , $ sIdentifier ) === 1 ;
245
+ return (\ strcasecmp ($ sIdentifier , $ sMatch ) === 0 )
246
+ ?: \ preg_match ("/^(- \\w+-)? $ sMatch$/i " , $ sIdentifier ) === 1 ;
247
247
}
248
248
249
249
/**
@@ -261,7 +261,7 @@ public function getLineNo()
261
261
*/
262
262
public function prepend ($ oItem ): void
263
263
{
264
- array_unshift ($ this ->aContents , $ oItem );
264
+ \ array_unshift ($ this ->aContents , $ oItem );
265
265
}
266
266
267
267
/**
@@ -283,7 +283,7 @@ public function append($oItem): void
283
283
*/
284
284
public function splice ($ iOffset , $ iLength = null , $ mReplacement = null ): void
285
285
{
286
- array_splice ($ this ->aContents , $ iOffset , $ iLength , $ mReplacement );
286
+ \ array_splice ($ this ->aContents , $ iOffset , $ iLength , $ mReplacement );
287
287
}
288
288
289
289
/**
@@ -295,7 +295,7 @@ public function splice($iOffset, $iLength = null, $mReplacement = null): void
295
295
*/
296
296
public function insertBefore ($ item , $ sibling ): void
297
297
{
298
- if (in_array ($ sibling , $ this ->aContents , true )) {
298
+ if (\ in_array ($ sibling , $ this ->aContents , true )) {
299
299
$ this ->replace ($ sibling , [$ item , $ sibling ]);
300
300
} else {
301
301
$ this ->append ($ item );
@@ -313,7 +313,7 @@ public function insertBefore($item, $sibling): void
313
313
*/
314
314
public function remove ($ oItemToRemove )
315
315
{
316
- $ iKey = array_search ($ oItemToRemove , $ this ->aContents , true );
316
+ $ iKey = \ array_search ($ oItemToRemove , $ this ->aContents , true );
317
317
if ($ iKey !== false ) {
318
318
unset($ this ->aContents [$ iKey ]);
319
319
return true ;
@@ -332,12 +332,12 @@ public function remove($oItemToRemove)
332
332
*/
333
333
public function replace ($ oOldItem , $ mNewItem )
334
334
{
335
- $ iKey = array_search ($ oOldItem , $ this ->aContents , true );
335
+ $ iKey = \ array_search ($ oOldItem , $ this ->aContents , true );
336
336
if ($ iKey !== false ) {
337
- if (is_array ($ mNewItem )) {
338
- array_splice ($ this ->aContents , $ iKey , 1 , $ mNewItem );
337
+ if (\ is_array ($ mNewItem )) {
338
+ \ array_splice ($ this ->aContents , $ iKey , 1 , $ mNewItem );
339
339
} else {
340
- array_splice ($ this ->aContents , $ iKey , 1 , [$ mNewItem ]);
340
+ \ array_splice ($ this ->aContents , $ iKey , 1 , [$ mNewItem ]);
341
341
}
342
342
return true ;
343
343
}
@@ -366,8 +366,8 @@ public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false
366
366
if ($ mSelector instanceof DeclarationBlock) {
367
367
$ mSelector = $ mSelector ->getSelectors ();
368
368
}
369
- if (!is_array ($ mSelector )) {
370
- $ mSelector = explode (', ' , $ mSelector );
369
+ if (!\ is_array ($ mSelector )) {
370
+ $ mSelector = \ explode (', ' , $ mSelector );
371
371
}
372
372
foreach ($ mSelector as $ iKey => &$ mSel ) {
373
373
if (!($ mSel instanceof Selector)) {
@@ -456,7 +456,7 @@ public function getContents()
456
456
*/
457
457
public function addComments (array $ aComments ): void
458
458
{
459
- $ this ->aComments = array_merge ($ this ->aComments , $ aComments );
459
+ $ this ->aComments = \ array_merge ($ this ->aComments , $ aComments );
460
460
}
461
461
462
462
/**
0 commit comments