src/LoggerFactory.php
public static function getFormatter(array $config = []): AbstractFormatter
    {
        if (!empty($config['instance'])) {
            $formatter = $config['instance'];
            unset($config['instance']);
        } else {
            $formatter = JsonFormatter::class;
        }

        return new $formatter($config);
    }
public static function getFormatter(array $config = []): AbstractFormatter
    {
        if (!empty($config['instance'])) {
            $formatter = $config['instance'];
            unset($config['instance']);
        } else {
            $formatter = JsonFormatter::class;
        }

        return new $formatter($config);
    }
public static function getFormatter ( array $ config = [ ] ) : AbstractFormatter { if ( ! empty ( $ config [ 'instance' ] ) ) { $ formatter = $ config [ 'instance' ] ; unset ( $ config [ 'instance' ] ) ; } else { $ formatter = JsonFormatter :: class ; } return new $ formatter ( $ config ) ; }
Initializes a formatter instance.
If the configuration is empty a default formatter is returned.
All settings except 'instance' are passed to the formatter constructor.
If declared, an 'instance' value must be a fully qualified class name.

@param array $config     Formatter settings
@return AbstractFormatter
Initializes a formatter instance . If the configuration is empty a default formatter is returned . All settings except instance are passed to the formatter constructor . If declared an instance value must be a fully qualified class name .