original_string: protected function scanOverrideFiles($directory, array &$results = array())
      {
          foreach (new DirectoryIterator($directory) as $file) {
              if ($file->isFile() && $file->getExtension() === 'php') {
                  $results[] = $file->getFilename();
              } elseif ($file->isDir() && !$file->isDot()) {
                  $this->scanOverrideFiles($file->getRealPath(), $results);
              }
          }
  
          return $results;
      }
code: protected function scanOverrideFiles($directory, array &$results = array())
      {
          foreach (new DirectoryIterator($directory) as $file) {
              if ($file->isFile() && $file->getExtension() === 'php') {
                  $results[] = $file->getFilename();
              } elseif ($file->isDir() && !$file->isDot()) {
                  $this->scanOverrideFiles($file->getRealPath(), $results);
              }
          }
  
          return $results;
      }
code_tokens: protected function scanOverrideFiles ( $ directory , array & $ results = array ( ) ) { foreach ( new DirectoryIterator ( $ directory ) as $ file ) { if ( $ file -> isFile ( ) && $ file -> getExtension ( ) === 'php' ) { $ results [ ] = $ file -> getFilename ( ) ; } elseif ( $ file -> isDir ( ) && ! $ file -> isDot ( ) ) { $ this -> scanOverrideFiles ( $ file -> getRealPath ( ) , $ results ) ; } } return $ results ; }
docstring: Recursively scans module override files
  @param string $directory
  @param array $results
  @return array
docstring_tokens: Recursively scans module override files