original_string: public function rsearch($folder, $pattern)
      {
          $dir      = new RecursiveDirectoryIterator($folder);
          $iterator = new RecursiveIteratorIterator($dir);
          $files    = new RegexIterator($iterator, $pattern, RegexIterator::GET_MATCH);
          $fileList = [];
  
          foreach ($files as $file) {
              $fileList = array_merge($fileList, $file);
          }
  
          return $fileList;
      }
code: public function rsearch($folder, $pattern)
      {
          $dir      = new RecursiveDirectoryIterator($folder);
          $iterator = new RecursiveIteratorIterator($dir);
          $files    = new RegexIterator($iterator, $pattern, RegexIterator::GET_MATCH);
          $fileList = [];
  
          foreach ($files as $file) {
              $fileList = array_merge($fileList, $file);
          }
  
          return $fileList;
      }
code_tokens: public function rsearch ( $ folder , $ pattern ) { $ dir = new RecursiveDirectoryIterator ( $ folder ) ; $ iterator = new RecursiveIteratorIterator ( $ dir ) ; $ files = new RegexIterator ( $ iterator , $ pattern , RegexIterator :: GET_MATCH ) ; $ fileList = [ ] ; foreach ( $ files as $ file ) { $ fileList = array_merge ( $ fileList , $ file ) ; } return $ fileList ; }
docstring: Search the given folder recursively for files using
  a regular expression pattern.
  
  @param  string  $folder
  @param  string  $pattern
  @return array
docstring_tokens: Search the given folder recursively for files using a regular expression pattern .