Пример #1
0
 /**
  * Processes specified file or directory.
  *
  * @param   string $path Absolute path to the file or directory.
  */
 protected function processFile($path)
 {
     if (is_dir($path)) {
         $files = scandir($path);
         foreach ($files as $file) {
             if ($file !== '.' && $file !== '..') {
                 $this->processFile(realpath(sprintf('%s%s%s', $path, DIRECTORY_SEPARATOR, $file)));
             }
         }
     } else {
         try {
             $file = new SourceFile($path);
             $this->literals = array_merge($this->literals, $file->getAllLiterals());
             $this->count++;
         } catch (\RuntimeException $e) {
         }
     }
 }