protected function printViolations(array $violations)
{
if (0 === count($violations)) {
return;
}
$tmpFile = null;
foreach ($violations as $i => $violation) {
if ($tmpFile !== $violation->getFile()) {
$tmpFile = $violation->getFile();
if (0 !== $i) {
$this->output->writeln('');
}
$this->output->writeln($tmpFile->getRelativePathname());
}
$this->output->writeln(sprintf('Nr. %d line %d: %s', ++$i, $violation->getLine(), $this->messageHelper->getViolationMessage($violation)));
}
}