@@ -60,14 +60,14 @@ public static function parse(ParserState $oParserState, $oList = null)
60
60
do {
61
61
$ aSelectorParts [] = $ oParserState ->consume (1 )
62
62
. $ oParserState ->consumeUntil (['{ ' , '} ' , '\'' , '" ' ], false , false , $ aComments );
63
- if (in_array ($ oParserState ->peek (), ['\'' , '" ' ]) && substr (end ($ aSelectorParts ), -1 ) != "\\" ) {
63
+ if (in_array ($ oParserState ->peek (), ['\'' , '" ' ], true ) && substr (end ($ aSelectorParts ), -1 ) != "\\" ) {
64
64
if ($ sStringWrapperChar === false ) {
65
65
$ sStringWrapperChar = $ oParserState ->peek ();
66
66
} elseif ($ sStringWrapperChar == $ oParserState ->peek ()) {
67
67
$ sStringWrapperChar = false ;
68
68
}
69
69
}
70
- } while (!in_array ($ oParserState ->peek (), ['{ ' , '} ' ]) || $ sStringWrapperChar !== false );
70
+ } while (!in_array ($ oParserState ->peek (), ['{ ' , '} ' ], true ) || $ sStringWrapperChar !== false );
71
71
$ oResult ->setSelectors (implode ('' , $ aSelectorParts ), $ oList );
72
72
if ($ oParserState ->comes ('{ ' )) {
73
73
$ oParserState ->consume (1 );
@@ -229,7 +229,7 @@ public function expandBorderShorthand(): void
229
229
} elseif ($ mValue instanceof Color) {
230
230
$ sNewRuleName = $ sBorderRule . "-color " ;
231
231
} else {
232
- if (in_array ($ mValue , $ aBorderSizes )) {
232
+ if (in_array ($ mValue , $ aBorderSizes, true )) {
233
233
$ sNewRuleName = $ sBorderRule . "-width " ;
234
234
} else {
235
235
$ sNewRuleName = $ sBorderRule . "-style " ;
@@ -338,20 +338,19 @@ public function expandFontShorthand(): void
338
338
if (!$ mValue instanceof Value) {
339
339
$ mValue = mb_strtolower ($ mValue );
340
340
}
341
- if (in_array ($ mValue , ['normal ' , 'inherit ' ])) {
341
+ if (in_array ($ mValue , ['normal ' , 'inherit ' ], true )) {
342
342
foreach (['font-style ' , 'font-weight ' , 'font-variant ' ] as $ sProperty ) {
343
343
if (!isset ($ aFontProperties [$ sProperty ])) {
344
344
$ aFontProperties [$ sProperty ] = $ mValue ;
345
345
}
346
346
}
347
- } elseif (in_array ($ mValue , ['italic ' , 'oblique ' ])) {
347
+ } elseif (in_array ($ mValue , ['italic ' , 'oblique ' ], true )) {
348
348
$ aFontProperties ['font-style ' ] = $ mValue ;
349
349
} elseif ($ mValue == 'small-caps ' ) {
350
350
$ aFontProperties ['font-variant ' ] = $ mValue ;
351
351
} elseif (
352
- in_array ($ mValue , ['bold ' , 'bolder ' , 'lighter ' ])
353
- || ($ mValue instanceof Size
354
- && in_array ($ mValue ->getSize (), range (100 , 900 , 100 )))
352
+ in_array ($ mValue , ['bold ' , 'bolder ' , 'lighter ' ], true )
353
+ || ($ mValue instanceof Size && in_array ($ mValue ->getSize (), range (100.0 , 900.0 , 100.0 ), true ))
355
354
) {
356
355
$ aFontProperties ['font-weight ' ] = $ mValue ;
357
356
} elseif ($ mValue instanceof RuleValueList && $ mValue ->getListSeparator () == '/ ' ) {
@@ -425,12 +424,12 @@ public function expandBackgroundShorthand(): void
425
424
$ aBgProperties ['background-image ' ] = $ mValue ;
426
425
} elseif ($ mValue instanceof Color) {
427
426
$ aBgProperties ['background-color ' ] = $ mValue ;
428
- } elseif (in_array ($ mValue , ['scroll ' , 'fixed ' ])) {
427
+ } elseif (in_array ($ mValue , ['scroll ' , 'fixed ' ], true )) {
429
428
$ aBgProperties ['background-attachment ' ] = $ mValue ;
430
- } elseif (in_array ($ mValue , ['repeat ' , 'no-repeat ' , 'repeat-x ' , 'repeat-y ' ])) {
429
+ } elseif (in_array ($ mValue , ['repeat ' , 'no-repeat ' , 'repeat-x ' , 'repeat-y ' ], true )) {
431
430
$ aBgProperties ['background-repeat ' ] = $ mValue ;
432
431
} elseif (
433
- in_array ($ mValue , ['left ' , 'center ' , 'right ' , 'top ' , 'bottom ' ])
432
+ in_array ($ mValue , ['left ' , 'center ' , 'right ' , 'top ' , 'bottom ' ], true )
434
433
|| $ mValue instanceof Size
435
434
) {
436
435
if ($ iNumBgPos == 0 ) {
@@ -516,9 +515,9 @@ public function expandListStyleShorthand(): void
516
515
}
517
516
if ($ mValue instanceof Url) {
518
517
$ aListProperties ['list-style-image ' ] = $ mValue ;
519
- } elseif (in_array ($ mValue , $ aListStyleTypes )) {
518
+ } elseif (in_array ($ mValue , $ aListStyleTypes, true )) {
520
519
$ aListProperties ['list-style-types ' ] = $ mValue ;
521
- } elseif (in_array ($ mValue , $ aListStylePositions )) {
520
+ } elseif (in_array ($ mValue , $ aListStylePositions, true )) {
522
521
$ aListProperties ['list-style-position ' ] = $ mValue ;
523
522
}
524
523
}
0 commit comments