private function reportParserErrors(array $errors)
{
/** @var FileProcessingException[] $errors */
foreach ($errors as $error) {
$output = null;
if ($this->configuration->getOption('debug')) {
$output = $error->getDetail();
} else {
/** @var \Exception[] $reasons */
$reasons = $error->getReasons();
if (isset($reasons[0]) && count($reasons)) {
$output = $reasons[0]->getMessage();
}
}
if ($output) {
$this->io->writeln(sprintf('<error>Parse error: "%s"</error>', $output));
}
}
}