protected function getConfigOption(array $config, $key)
    {
        if (empty($config[$key]) || !is_string($config[$key])) {
            throw new \DomainException(
                "$key must be a non-empty string"
            );
        }
        return $config[$key];
    }