@@ -33,12 +33,12 @@ public function __construct(string $label, int $line = 0, string $href = null)
3333 if (!\is_string ($ href )) {
3434 return ;
3535 }
36- if (0 === strpos ($ href , 'file:// ' )) {
36+ if (str_starts_with ($ href , 'file:// ' )) {
3737 if ($ href === $ label ) {
3838 $ label = substr ($ label , 7 );
3939 }
4040 $ href = substr ($ href , 7 );
41- } elseif (false !== strpos ($ href , ':// ' )) {
41+ } elseif (str_contains ($ href , ':// ' )) {
4242 $ this ->attr ['href ' ] = $ href ;
4343
4444 return ;
@@ -69,7 +69,7 @@ private function getComposerRoot(string $file, bool &$inVendor)
6969 self ::$ vendorRoots = [];
7070
7171 foreach (get_declared_classes () as $ class ) {
72- if ('C ' === $ class [0 ] && 0 === strpos ($ class , 'ComposerAutoloaderInit ' )) {
72+ if ('C ' === $ class [0 ] && str_starts_with ($ class , 'ComposerAutoloaderInit ' )) {
7373 $ r = new \ReflectionClass ($ class );
7474 $ v = \dirname ($ r ->getFileName (), 2 );
7575 if (file_exists ($ v .'/composer/installed.json ' )) {
@@ -85,7 +85,7 @@ private function getComposerRoot(string $file, bool &$inVendor)
8585 }
8686
8787 foreach (self ::$ vendorRoots as $ root ) {
88- if ($ inVendor = 0 === strpos ($ file , $ root )) {
88+ if ($ inVendor = str_starts_with ($ file , $ root )) {
8989 return $ root ;
9090 }
9191 }
0 commit comments