protected function printStackTrace(OutputInterface $output, array $trace)
{
$rootFolder = $this->getApplication()->getMagentoRootFolder();
$trace = array_filter($trace, function (&$row) use($rootFolder) {
if (!strstr($row['file'], $rootFolder)) {
return false;
}
$row['file'] = ltrim(str_replace($rootFolder, '', $row['file']), '/');
return $row;
});
$table = $this->getHelper('table');
$rows = array();
$i = 1;
foreach ($trace as $row) {
$rows[] = array($i++, $row['file'] . ':' . $row['line'], $row['class'] . '::' . $row['function']);
}
$table->setHeaders(array('#', 'File/Line', 'Method'));
$table->setRows($rows);
$table->render($output);
}