foreach ($this->
splitStringByWidth($line,
$width - 4
) as $line) { // pre-format lines to get the right string length
$lineLength = Helper::
width($line) + 4;
$lines[] =
[$line,
$lineLength];
$len =
max($lineLength,
$len);
} } $messages =
[];
if (!
$e instanceof ExceptionInterface || OutputInterface::VERBOSITY_VERBOSE <=
$output->
getVerbosity()) { $messages[] =
sprintf('<comment>%s</comment>', OutputFormatter::
escape(sprintf('In %s line %s:',
basename($e->
getFile()) ?: 'n/a',
$e->
getLine() ?: 'n/a'
)));
} $messages[] =
$emptyLine =
sprintf('<error>%s</error>',
str_repeat(' ',
$len));
if ('' ===
$message || OutputInterface::VERBOSITY_VERBOSE <=
$output->
getVerbosity()) { $messages[] =
sprintf('<error>%s%s</error>',
$title,
str_repeat(' ',
max(0,
$len - Helper::
width($title))));
} foreach ($lines as $line) { $messages[] =
sprintf('<error> %s %s</error>', OutputFormatter::
escape($line[0
]),
str_repeat(' ',
$len -
$line[1
]));
} $messages[] =
$emptyLine;
$messages[] = '';