private function handlePHPCSErrors(File $file, \PHP_CodeSniffer_File $phpcsFile)
{
$maxLine = strlen(max(array_keys($phpcsFile->getErrors())));
$byLine = $this->prepareFileContent($file);
foreach ($phpcsFile->getErrors() as $lineNumber => $errorsByLine) {
$message = sprintf(" | Line %{$maxLine}s:%s\n", $lineNumber, $byLine[$lineNumber + 1]);
foreach ($errorsByLine as $column => $errorsCollection) {
foreach ($errorsCollection as $error) {
$message .= sprintf(" |%{$maxLine}s| Error at column %s: %s\n", '', $column, $error['message']);
}
}
$this->pushError($message);
}
}