public function getFormatterByName($name)
{
foreach ($this->formatters as $formatter) {
if (strtolower($name) != strtolower($formatter->getName())) {
continue;
}
return $formatter;
}
throw new \LogicException(sprintf('Formatter %s does not exists, did you mean %s?', $name, implode(', ', array_map(function (OutputFormatterInterface $f) {
return $f->getName();
}, $this->formatters))));
}