@@ -73,12 +73,12 @@ public function getLocator()
7373 */
7474 public function import ($ resource , $ type = null , $ ignoreErrors = false , $ sourceResource = null /*, $exclude = null*/ )
7575 {
76- if (\func_num_args () < 5 && __CLASS__ !== static ::class && 0 !== strpos (static ::class, 'Symfony\Component \\' ) && __CLASS__ !== (new \ReflectionMethod ($ this , __FUNCTION__ ))->getDeclaringClass ()->getName () && !$ this instanceof \PHPUnit \Framework \MockObject \MockObject && !$ this instanceof \Prophecy \Prophecy \ProphecySubjectInterface && !$ this instanceof \Mockery \MockInterface) {
76+ if (\func_num_args () < 5 && __CLASS__ !== static ::class && ! str_starts_with (static ::class, 'Symfony\Component \\' ) && __CLASS__ !== (new \ReflectionMethod ($ this , __FUNCTION__ ))->getDeclaringClass ()->getName () && !$ this instanceof \PHPUnit \Framework \MockObject \MockObject && !$ this instanceof \Prophecy \Prophecy \ProphecySubjectInterface && !$ this instanceof \Mockery \MockInterface) {
7777 @trigger_error (sprintf ('The "%s()" method will have a new "$exclude = null" argument in version 5.0, not defining it is deprecated since Symfony 4.4. ' , __METHOD__ ), \E_USER_DEPRECATED );
7878 }
7979 $ exclude = \func_num_args () >= 5 ? func_get_arg (4 ) : null ;
8080
81- if (\is_string ($ resource ) && \strlen ($ resource ) !== ($ i = strcspn ($ resource , '*?{[ ' )) && false === strpos ($ resource , "\n" )) {
81+ if (\is_string ($ resource ) && \strlen ($ resource ) !== ($ i = strcspn ($ resource , '*?{[ ' )) && ! str_contains ($ resource , "\n" )) {
8282 $ excluded = [];
8383 foreach ((array ) $ exclude as $ pattern ) {
8484 foreach ($ this ->glob ($ pattern , true , $ _ , false , true ) as $ path => $ info ) {
@@ -88,7 +88,7 @@ public function import($resource, $type = null, $ignoreErrors = false, $sourceRe
8888 }
8989
9090 $ ret = [];
91- $ isSubpath = 0 !== $ i && false !== strpos (substr ($ resource , 0 , $ i ), '/ ' );
91+ $ isSubpath = 0 !== $ i && str_contains (substr ($ resource , 0 , $ i ), '/ ' );
9292 foreach ($ this ->glob ($ resource , false , $ _ , $ ignoreErrors || !$ isSubpath , false , $ excluded ) as $ path => $ info ) {
9393 if (null !== $ res = $ this ->doImport ($ path , 'glob ' === $ type ? null : $ type , $ ignoreErrors , $ sourceResource )) {
9494 $ ret [] = $ res ;
@@ -112,7 +112,7 @@ protected function glob(string $pattern, bool $recursive, &$resource = null, boo
112112 if (\strlen ($ pattern ) === $ i = strcspn ($ pattern , '*?{[ ' )) {
113113 $ prefix = $ pattern ;
114114 $ pattern = '' ;
115- } elseif (0 === $ i || false === strpos (substr ($ pattern , 0 , $ i ), '/ ' )) {
115+ } elseif (0 === $ i || ! str_contains (substr ($ pattern , 0 , $ i ), '/ ' )) {
116116 $ prefix = '. ' ;
117117 $ pattern = '/ ' .$ pattern ;
118118 } else {
0 commit comments