@@ -2495,7 +2495,7 @@ private function parseDeclaration() {
2495
2495
// Custom property values get permissive parsing
2496
2496
if ( is_array ( $ name ) && array_key_exists ( 0 , $ name ) // to satisfy phan
2497
2497
&& $ name [0 ] instanceof Less_Tree_Keyword
2498
- && $ name [0 ]->value && strpos ( $ name [0 ]->value , '-- ' ) === 0 ) {
2498
+ && $ name [0 ]->value && str_starts_with ( $ name [0 ]->value , '-- ' ) ) {
2499
2499
$ value = $ this ->parsePermissiveValue ( [ '; ' , '} ' ] );
2500
2500
} else {
2501
2501
// Try to store values as anonymous
@@ -3354,7 +3354,7 @@ public static function serializeVars( $vars ) {
3354
3354
if ( strval ( $ value ) === "" ) {
3355
3355
$ value = '~"" ' ;
3356
3356
}
3357
- $ s .= ( ( $ name[ 0 ] === '@ ' ) ? '' : '@ ' ) . $ name . ': ' . $ value . ( ( substr ( $ value , - 1 ) === '; ' ) ? '' : '; ' );
3357
+ $ s .= ( str_starts_with ( $ name, '@ ' ) ? '' : '@ ' ) . $ name . ': ' . $ value . ( str_ends_with ( $ value , '; ' ) ? '' : '; ' );
3358
3358
}
3359
3359
3360
3360
return $ s ;
@@ -3389,7 +3389,7 @@ public static function WinPath( $path ) {
3389
3389
}
3390
3390
3391
3391
public static function AbsPath ( $ path , $ winPath = false ) {
3392
- if ( strpos ( $ path , '// ' ) !== false && preg_match ( '/^(https?:)?\/\//i ' , $ path ) ) {
3392
+ if ( str_contains ( $ path , '// ' ) && preg_match ( '/^(https?:)?\/\//i ' , $ path ) ) {
3393
3393
return $ winPath ? '' : false ;
3394
3394
} else {
3395
3395
$ path = realpath ( $ path );
0 commit comments