public function createFormatter(string $id, string $type, array $config): FormatterInterface
    {
        if (!isset($this->_formatters[$id])) {
            switch ($type) {
                case self::FORMATTER_TYPE_LINE:
                    $config = array_replace(
                        [
                            'format'                        => null,
                            'dateFormat'                    => null,
                            'allowInlineLineBreaks'         => false,
                            'ignoreEmptyContextAndExtra'    => false
                        ],
                        $config
                    );

                    $this->_formatters[$id] = new LineFormatter(
                        $config['format'],
                        $config['dateFormat'],
                        $config['allowInlineLineBreaks'],
                        $config['ignoreEmptyContextAndExtra']
                    );

                    break;
                default:
                    throw InvalidConfigException::create(
                        'type',
                        'string',
                        'Allowed types: '.implode(', ', self::$availableFormatterTypes)
                    );
            }
        }

        return $this->_formatters[$id];
    }