@@ -167,28 +167,31 @@ function (\SplFileInfo $file, $path) {
167167            throw  new  \LogicException (sprintf ('Extended glob pattern "%s" cannot be used as the Finder component is not installed. ' , $ this pattern ));
168168        }
169169
170-         $ findernew  Finder ();
171170        $ regextoRegex ($ this pattern );
172171        if  ($ this recursive ) {
173172            $ regexsubstr_replace ($ regex'(/|$) ' , -2 , 1 );
174173        }
175174
176175        $ prefixLen\strlen ($ this prefix );
177-         foreach  ($ finderfollowLinks ()->sortByName ()->in ($ this prefix ) as  $ path$ info
178-             $ normalizedPathstr_replace ('\\' , '/ ' , $ path
179-             if  (!preg_match ($ regexsubstr ($ normalizedPath$ prefixLen$ infoisFile ()) {
180-                 continue ;
181-             }
182-             if  ($ this excludedPrefixes ) {
183-                 do  {
184-                     if  (isset ($ this excludedPrefixes [$ dirPath$ normalizedPath
185-                         continue  2 ;
186-                     }
187-                 } while  ($ prefix$ dirPath$ dirPath$ normalizedPath\dirname ($ dirPath
188-             }
189176
190-             yield  $ path$ info
191-         }
177+         yield  from  (new  Finder ())
178+             ->followLinks ()
179+             ->filter (function  (\SplFileInfo   $ infouse  ($ regex$ prefixLen$ prefix
180+                 $ normalizedPathstr_replace ('\\' , '/ ' , $ infogetPathname ());
181+                 if  (!preg_match ($ regexsubstr ($ normalizedPath$ prefixLen$ infoisFile ()) {
182+                     return  false ;
183+                 }
184+                 if  ($ this excludedPrefixes ) {
185+                     do  {
186+                         if  (isset ($ this excludedPrefixes [$ dirPath$ normalizedPath
187+                             return  false ;
188+                         }
189+                     } while  ($ prefix$ dirPath$ dirPath$ normalizedPath\dirname ($ dirPath
190+                 }
191+             })
192+             ->sortByName ()
193+             ->in ($ this prefix )
194+         ;
192195    }
193196
194197    private  function  computeHash (): string 
0 commit comments