@@ -574,7 +574,7 @@ public static function makeRelative(string $path, string $basePath): string
574
574
*/
575
575
public static function isLocal (string $ path ): bool
576
576
{
577
- return '' !== $ path && false === mb_strpos ($ path , ':// ' );
577
+ return '' !== $ path && ! str_contains ($ path , ':// ' );
578
578
}
579
579
580
580
/**
@@ -638,7 +638,7 @@ public static function getLongestCommonBasePath(string ...$paths): ?string
638
638
639
639
// Prevent false positives for common prefixes
640
640
// see isBasePath()
641
- if (0 === mb_strpos ($ path .'/ ' , $ basePath .'/ ' )) {
641
+ if (str_starts_with ($ path .'/ ' , $ basePath .'/ ' )) {
642
642
// next path
643
643
continue 2 ;
644
644
}
@@ -666,7 +666,7 @@ public static function join(string ...$paths): string
666
666
if (null === $ finalPath ) {
667
667
// For first part we keep slashes, like '/top', 'C:\' or 'phar://'
668
668
$ finalPath = $ path ;
669
- $ wasScheme = ( false !== mb_strpos ( $ path , ':// ' ) );
669
+ $ wasScheme = str_contains ( $ path , ':// ' );
670
670
continue ;
671
671
}
672
672
@@ -717,7 +717,7 @@ public static function isBasePath(string $basePath, string $ofPath): bool
717
717
// Don't append a slash for the root "/", because then that root
718
718
// won't be discovered as common prefix ("//" is not a prefix of
719
719
// "/foobar/").
720
- return 0 === mb_strpos ($ ofPath .'/ ' , rtrim ($ basePath , '/ ' ).'/ ' );
720
+ return str_starts_with ($ ofPath .'/ ' , rtrim ($ basePath , '/ ' ).'/ ' );
721
721
}
722
722
723
723
/**
@@ -786,7 +786,7 @@ private static function split(string $path): array
786
786
$ length = mb_strlen ($ path );
787
787
788
788
// Remove and remember root directory
789
- if (0 === mb_strpos ($ path , '/ ' )) {
789
+ if (str_starts_with ($ path , '/ ' )) {
790
790
$ root .= '/ ' ;
791
791
$ path = $ length > 1 ? mb_substr ($ path , 1 ) : '' ;
792
792
} elseif ($ length > 1 && ctype_alpha ($ path [0 ]) && ': ' === $ path [1 ]) {
0 commit comments