protected function getKey(array $config)
    {
        if (!isset($config['key']) || !is_string($config['key'])) {
            throw new \DomainException(
                'key must reference a string',
                self::ERR_INVALID_KEY
            );
        }
        return $config['key'];
    }