@@ -104,7 +104,7 @@ public function __construct($message, array $trace, $file, $languageDeprecation
104104 $ this ->getOriginalFilesStack ();
105105 array_splice ($ this ->originalFilesStack , 0 , $ j , [$ this ->triggeringFile ]);
106106
107- if (preg_match ('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/ ' , $ message , $ m ) || (! str_contains ($ message , '()" will return ' ) && ! str_contains ($ message , 'native return type declaration ' ) && preg_match ('/^(?:The|Method) "([^":]++)/ ' , $ message , $ m ))) {
107+ if (preg_match ('/(?|"([^"]++)" that is deprecated|should implement method "(?:static )?([^:]++))/ ' , $ message , $ m ) || (false === strpos ($ message , '()" will return ' ) && false === strpos ($ message , 'native return type declaration ' ) && preg_match ('/^(?:The|Method) "([^":]++)/ ' , $ message , $ m ))) {
108108 $ this ->triggeringFile = (new \ReflectionClass ($ m [1 ]))->getFileName ();
109109 array_unshift ($ this ->originalFilesStack , $ this ->triggeringFile );
110110 }
@@ -142,7 +142,7 @@ public function __construct($message, array $trace, $file, $languageDeprecation
142142 return ;
143143 }
144144
145- if (!isset ($ line ['class ' ], $ trace [$ i - 2 ]['function ' ]) || ! str_starts_with ($ line ['class ' ], SymfonyTestsListenerFor::class)) {
145+ if (!isset ($ line ['class ' ], $ trace [$ i - 2 ]['function ' ]) || 0 !== strpos ($ line ['class ' ], SymfonyTestsListenerFor::class)) {
146146 $ this ->originClass = isset ($ line ['object ' ]) ? \get_class ($ line ['object ' ]) : $ line ['class ' ];
147147 $ this ->originMethod = $ line ['function ' ];
148148
@@ -169,7 +169,7 @@ private function lineShouldBeSkipped(array $line)
169169 }
170170 $ class = $ line ['class ' ];
171171
172- return 'ReflectionMethod ' === $ class || str_starts_with ($ class , 'PHPUnit \\' );
172+ return 'ReflectionMethod ' === $ class || 0 === strpos ($ class , 'PHPUnit \\' );
173173 }
174174
175175 /**
@@ -211,7 +211,7 @@ public function originatingClass()
211211
212212 $ class = $ this ->originClass ;
213213
214- return str_contains ($ class , "@anonymous \0" ) ? (get_parent_class ($ class ) ?: key (class_implements ($ class )) ?: 'class ' ).'@anonymous ' : $ class ;
214+ return false !== strpos ($ class , "@anonymous \0" ) ? (get_parent_class ($ class ) ?: key (class_implements ($ class )) ?: 'class ' ).'@anonymous ' : $ class ;
215215 }
216216
217217 /**
@@ -246,9 +246,9 @@ public function isLegacy()
246246 $ method = $ this ->originatingMethod ();
247247 $ groups = class_exists (Groups::class, false ) ? [new Groups (), 'groups ' ] : [Test::class, 'getGroups ' ];
248248
249- return str_starts_with ($ method , 'testLegacy ' )
250- || str_starts_with ($ method , 'provideLegacy ' )
251- || str_starts_with ($ method , 'getLegacy ' )
249+ return 0 === strpos ($ method , 'testLegacy ' )
250+ || 0 === strpos ($ method , 'provideLegacy ' )
251+ || 0 === strpos ($ method , 'getLegacy ' )
252252 || strpos ($ this ->originClass , '\Legacy ' )
253253 || \in_array ('legacy ' , $ groups ($ this ->originClass , $ method ), true );
254254 }
@@ -262,10 +262,10 @@ public function isMuted()
262262 return false ;
263263 }
264264 if (isset ($ this ->trace [1 ]['class ' ])) {
265- return str_starts_with ($ this ->trace [1 ]['class ' ], 'PHPUnit \\' );
265+ return 0 === strpos ($ this ->trace [1 ]['class ' ], 'PHPUnit \\' );
266266 }
267267
268- return str_contains ($ this ->triggeringFile , \DIRECTORY_SEPARATOR .'vendor ' .\DIRECTORY_SEPARATOR .'phpunit ' .\DIRECTORY_SEPARATOR );
268+ return false !== strpos ($ this ->triggeringFile , \DIRECTORY_SEPARATOR .'vendor ' .\DIRECTORY_SEPARATOR .'phpunit ' .\DIRECTORY_SEPARATOR );
269269 }
270270
271271 /**
@@ -340,7 +340,7 @@ private function getPackage($path)
340340 {
341341 $ path = realpath ($ path ) ?: $ path ;
342342 foreach (self ::getVendors () as $ vendorRoot ) {
343- if (str_starts_with ($ path , $ vendorRoot )) {
343+ if (0 === strpos ($ path , $ vendorRoot )) {
344344 $ relativePath = substr ($ path , \strlen ($ vendorRoot ) + 1 );
345345 $ vendor = strstr ($ relativePath , \DIRECTORY_SEPARATOR , true );
346346 if (false === $ vendor ) {
@@ -366,7 +366,7 @@ private static function getVendors()
366366 self ::$ vendors [] = \dirname ((new \ReflectionClass (DebugClassLoader::class))->getFileName ());
367367 }
368368 foreach (get_declared_classes () as $ class ) {
369- if ('C ' === $ class [0 ] && str_starts_with ($ class , 'ComposerAutoloaderInit ' )) {
369+ if ('C ' === $ class [0 ] && 0 === strpos ($ class , 'ComposerAutoloaderInit ' )) {
370370 $ r = new \ReflectionClass ($ class );
371371 $ v = \dirname ($ r ->getFileName (), 2 );
372372 if (file_exists ($ v .'/composer/installed.json ' )) {
@@ -381,7 +381,7 @@ private static function getVendors()
381381 }
382382 foreach ($ paths as $ path ) {
383383 foreach (self ::$ vendors as $ vendor ) {
384- if (! str_starts_with ($ path , $ vendor )) {
384+ if (0 !== strpos ($ path , $ vendor )) {
385385 self ::$ internalPaths [] = $ path ;
386386 }
387387 }
@@ -416,13 +416,13 @@ private function getPathType($path)
416416 return self ::PATH_TYPE_UNDETERMINED ;
417417 }
418418 foreach (self ::getVendors () as $ vendor ) {
419- if (str_starts_with ($ realPath , $ vendor ) && false !== strpbrk (substr ($ realPath , \strlen ($ vendor ), 1 ), '/ ' .\DIRECTORY_SEPARATOR )) {
419+ if (0 === strpos ($ realPath , $ vendor ) && false !== strpbrk (substr ($ realPath , \strlen ($ vendor ), 1 ), '/ ' .\DIRECTORY_SEPARATOR )) {
420420 return self ::PATH_TYPE_VENDOR ;
421421 }
422422 }
423423
424424 foreach (self ::$ internalPaths as $ internalPath ) {
425- if (str_starts_with ($ realPath , $ internalPath )) {
425+ if (0 === strpos ($ realPath , $ internalPath )) {
426426 return self ::PATH_TYPE_SELF ;
427427 }
428428 }
0 commit comments