protected static function validateFormatter($formatter)
    {
        if (is_subclass_of($formatter, Formatter::class)) {
            return [is_string($formatter) ? new $formatter() : $formatter, 'format'];
        }
        if (is_callable($formatter)) {
            return $formatter;
        }
        throw new InvalidArgumentException('Formatter must be an instanceof ' . Formatter::class . ' or callable.');
    }