@@ -63,13 +63,13 @@ public function __construct($iLineNo = 0)
6363 public static function parseList (ParserState $ oParserState , CSSList $ oList ): void
6464 {
6565 $ bIsRoot = $ oList instanceof Document;
66- if (is_string ($ oParserState )) {
66+ if (\ is_string ($ oParserState )) {
6767 $ oParserState = new ParserState ($ oParserState , Settings::create ());
6868 }
6969 $ bLenientParsing = $ oParserState ->getSettings ()->bLenientParsing ;
7070 $ aComments = [];
7171 while (!$ oParserState ->isEnd ()) {
72- $ aComments = array_merge ($ aComments , $ oParserState ->consumeWhiteSpace ());
72+ $ aComments = \ array_merge ($ aComments , $ oParserState ->consumeWhiteSpace ());
7373 $ oListItem = null ;
7474 if ($ bLenientParsing ) {
7575 try {
@@ -117,7 +117,7 @@ private static function parseListItem(ParserState $oParserState, CSSList $oList)
117117 $ oParserState ->currentLine ()
118118 );
119119 }
120- if (count ($ oList ->getContents ()) > 0 ) {
120+ if (\ count ($ oList ->getContents ()) > 0 ) {
121121 throw new UnexpectedTokenException (
122122 '@charset must be the first parseable token in a document ' ,
123123 '' ,
@@ -164,7 +164,7 @@ private static function parseAtRule(ParserState $oParserState)
164164 $ oParserState ->consumeWhiteSpace ();
165165 $ sMediaQuery = null ;
166166 if (!$ oParserState ->comes ('; ' )) {
167- $ sMediaQuery = trim ($ oParserState ->consumeUntil (['; ' , ParserState::EOF ]));
167+ $ sMediaQuery = \ trim ($ oParserState ->consumeUntil (['; ' , ParserState::EOF ]));
168168 }
169169 $ oParserState ->consumeUntil (['; ' , ParserState::EOF ], true , true );
170170 return new Import ($ oLocation , $ sMediaQuery ?: null , $ iIdentifierLineNum );
@@ -176,7 +176,7 @@ private static function parseAtRule(ParserState $oParserState)
176176 } elseif (self ::identifierIs ($ sIdentifier , 'keyframes ' )) {
177177 $ oResult = new KeyFrame ($ iIdentifierLineNum );
178178 $ oResult ->setVendorKeyFrame ($ sIdentifier );
179- $ oResult ->setAnimationName (trim ($ oParserState ->consumeUntil ('{ ' , false , true )));
179+ $ oResult ->setAnimationName (\ trim ($ oParserState ->consumeUntil ('{ ' , false , true )));
180180 CSSList::parseList ($ oParserState , $ oResult );
181181 if ($ oParserState ->comes ('} ' )) {
182182 $ oParserState ->consume ('} ' );
@@ -190,7 +190,7 @@ private static function parseAtRule(ParserState $oParserState)
190190 $ mUrl = Value::parsePrimitiveValue ($ oParserState );
191191 }
192192 $ oParserState ->consumeUntil (['; ' , ParserState::EOF ], true , true );
193- if ($ sPrefix !== null && !is_string ($ sPrefix )) {
193+ if ($ sPrefix !== null && !\ is_string ($ sPrefix )) {
194194 throw new UnexpectedTokenException ('Wrong namespace prefix ' , $ sPrefix , 'custom ' , $ iIdentifierLineNum );
195195 }
196196 if (!($ mUrl instanceof CSSString || $ mUrl instanceof URL )) {
@@ -204,16 +204,16 @@ private static function parseAtRule(ParserState $oParserState)
204204 return new CSSNamespace ($ mUrl , $ sPrefix , $ iIdentifierLineNum );
205205 } else {
206206 // 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 , ") " )) {
209209 if ($ oParserState ->getSettings ()->bLenientParsing ) {
210210 return null ;
211211 } else {
212212 throw new SourceException ("Unmatched brace count in media query " , $ oParserState ->currentLine ());
213213 }
214214 }
215215 $ bUseRuleSet = true ;
216- foreach (explode ('/ ' , AtRule::BLOCK_RULES ) as $ sBlockRuleName ) {
216+ foreach (\ explode ('/ ' , AtRule::BLOCK_RULES ) as $ sBlockRuleName ) {
217217 if (self ::identifierIs ($ sIdentifier , $ sBlockRuleName )) {
218218 $ bUseRuleSet = false ;
219219 break ;
@@ -242,8 +242,8 @@ private static function parseAtRule(ParserState $oParserState)
242242 */
243243 private static function identifierIs ($ sIdentifier , $ sMatch ): bool
244244 {
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 ;
247247 }
248248
249249 /**
@@ -261,7 +261,7 @@ public function getLineNo()
261261 */
262262 public function prepend ($ oItem ): void
263263 {
264- array_unshift ($ this ->aContents , $ oItem );
264+ \ array_unshift ($ this ->aContents , $ oItem );
265265 }
266266
267267 /**
@@ -283,7 +283,7 @@ public function append($oItem): void
283283 */
284284 public function splice ($ iOffset , $ iLength = null , $ mReplacement = null ): void
285285 {
286- array_splice ($ this ->aContents , $ iOffset , $ iLength , $ mReplacement );
286+ \ array_splice ($ this ->aContents , $ iOffset , $ iLength , $ mReplacement );
287287 }
288288
289289 /**
@@ -295,7 +295,7 @@ public function splice($iOffset, $iLength = null, $mReplacement = null): void
295295 */
296296 public function insertBefore ($ item , $ sibling ): void
297297 {
298- if (in_array ($ sibling , $ this ->aContents , true )) {
298+ if (\ in_array ($ sibling , $ this ->aContents , true )) {
299299 $ this ->replace ($ sibling , [$ item , $ sibling ]);
300300 } else {
301301 $ this ->append ($ item );
@@ -313,7 +313,7 @@ public function insertBefore($item, $sibling): void
313313 */
314314 public function remove ($ oItemToRemove )
315315 {
316- $ iKey = array_search ($ oItemToRemove , $ this ->aContents , true );
316+ $ iKey = \ array_search ($ oItemToRemove , $ this ->aContents , true );
317317 if ($ iKey !== false ) {
318318 unset($ this ->aContents [$ iKey ]);
319319 return true ;
@@ -332,12 +332,12 @@ public function remove($oItemToRemove)
332332 */
333333 public function replace ($ oOldItem , $ mNewItem )
334334 {
335- $ iKey = array_search ($ oOldItem , $ this ->aContents , true );
335+ $ iKey = \ array_search ($ oOldItem , $ this ->aContents , true );
336336 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 );
339339 } else {
340- array_splice ($ this ->aContents , $ iKey , 1 , [$ mNewItem ]);
340+ \ array_splice ($ this ->aContents , $ iKey , 1 , [$ mNewItem ]);
341341 }
342342 return true ;
343343 }
@@ -366,8 +366,8 @@ public function removeDeclarationBlockBySelector($mSelector, $bRemoveAll = false
366366 if ($ mSelector instanceof DeclarationBlock) {
367367 $ mSelector = $ mSelector ->getSelectors ();
368368 }
369- if (!is_array ($ mSelector )) {
370- $ mSelector = explode (', ' , $ mSelector );
369+ if (!\ is_array ($ mSelector )) {
370+ $ mSelector = \ explode (', ' , $ mSelector );
371371 }
372372 foreach ($ mSelector as $ iKey => &$ mSel ) {
373373 if (!($ mSel instanceof Selector)) {
@@ -456,7 +456,7 @@ public function getContents()
456456 */
457457 public function addComments (array $ aComments ): void
458458 {
459- $ this ->aComments = array_merge ($ this ->aComments , $ aComments );
459+ $ this ->aComments = \ array_merge ($ this ->aComments , $ aComments );
460460 }
461461
462462 /**
0 commit comments