public function visitFile(File $file)
{
foreach ($file->getLines() as $line => $data) {
if ($data['ending'] !== '' && $data['ending'] !== $this->eolChar) {
$ending = str_replace(array("\r", "\n"), array('\\r', '\\n'), $data['ending']);
$this->addViolation($file, $line, 0, sprintf('Line must end with "%s", found "%s"', $this->eolName, $ending));
}
}
}