protected printFile ( Symfony\Component\Console\Output\OutputInterface $output, $e ) | ||
$output | Symfony\Component\Console\Output\OutputInterface | |
$e |
protected function printFile(OutputInterface $output, $e)
{
if (preg_match('/Error\\sin\\sfile\\:\\s"(.+)\\"\\s-/', $e->getMessage(), $matches)) {
$table = $this->getHelper('table');
$lines = \file($matches[1]);
$rows = array();
$i = 0;
foreach ($lines as $line) {
$rows[] = array(++$i, rtrim($line));
}
$table->setHeaders(array('Line', 'Code'));
$table->setRows($rows);
$table->render($output);
}
}