public function setConfig($config)
    {
        if (0 == count($config)) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'Compare Rule requires an argument to compare with'
            );
        }
        $config = self::toCanonicalForm($config);

        $config += array('operator' => '===');
        if (!in_array($config['operator'], $this->operators)) {
            throw new HTML_QuickForm2_InvalidArgumentException(
                'Compare Rule requires a valid comparison operator, ' .
                preg_replace('/\s+/', ' ', var_export($config['operator'], true)) . ' given'
            );
        }
        if (in_array($config['operator'], array('==', '!='))) {
            $config['operator'] .= '=';
        }

        return parent::setConfig($config);
    }