public function parsePhpFiles($path)
{
$files = $this->finderFactory->createFinder()->in($path);
$parsedFiles = array();
$parserErrors = array();
$this->progressOutput->start($fileCount = $files->count());
$i = 0;
foreach ($files->getIterator() as $file) {
$file = PhpFileInfo::create($file);
try {
$this->progressOutput->advance(++$i, $file);
$this->parser->parseFile($file);
} catch (Error $ex) {
$raw = $ex->getRawMessage() . ' in file ' . $file;
$ex->setRawMessage($raw);
$parserErrors[] = $ex;
}
$parsedFiles[] = $file;
}
$this->progressOutput->end();
return new Result($parsedFiles, $parserErrors, $fileCount);
}