<commit_before><?php

class CM_FormField_Set_Select extends CM_FormField_Set {

    const DISPLAY_SELECT = 'select';
    const DISPLAY_RADIOS = 'radios';

    public function validate($userInput, CM_Response_Abstract $response) {
        if (!in_array($userInput, $this->_getValues())) {
            throw new CM_Exception_FormFieldValidation('Invalid value');
        }
        return $userInput;
    }

    public function prepare(CM_Params $renderParams, CM_Frontend_ViewResponse $viewResponse) {
        $display = $renderParams->getString('display', self::DISPLAY_SELECT);
        if (!in_array($display, array(self::DISPLAY_SELECT, self::DISPLAY_RADIOS), true)) {
            throw new CM_Exception_InvalidParam('Display needs to be either `select` or `radios`');
        }
        $viewResponse->set('display', $display);
        $viewResponse->set('class', $renderParams->has('class') ? $renderParams->getString('class') : null);

        $viewResponse->set('placeholder', $renderParams->getBoolean('placeholder', false));
        $viewResponse->set('optionList', $this->_getOptionList());
        $viewResponse->set('labelPrefix', $renderParams->has('') ? $renderParams->getString('labelPrefix') : null);

        $viewResponse->set('translate', $renderParams->getBoolean('translate', false) || $renderParams->has('translatePrefix'));
        $viewResponse->set('translatePrefix', $renderParams->has('') ? $renderParams->getString('translatePrefix') : null);
    }
}<commit_msg>Fix FF Set Select<commit_after><?php

class CM_FormField_Set_Select extends CM_FormField_Set {

    const DISPLAY_SELECT = 'select';
    const DISPLAY_RADIOS = 'radios';

    public function validate($userInput, CM_Response_Abstract $response) {
        if (!in_array($userInput, $this->_getValues())) {
            throw new CM_Exception_FormFieldValidation('Invalid value');
        }
        return $userInput;
    }

    public function prepare(CM_Params $renderParams, CM_Frontend_ViewResponse $viewResponse) {
        $display = $renderParams->getString('display', self::DISPLAY_SELECT);
        if (!in_array($display, array(self::DISPLAY_SELECT, self::DISPLAY_RADIOS), true)) {
            throw new CM_Exception_InvalidParam('Display needs to be either `select` or `radios`');
        }
        $viewResponse->set('display', $display);
        $viewResponse->set('class', $renderParams->has('class') ? $renderParams->getString('class') : null);

        $viewResponse->set('placeholder', $renderParams->getBoolean('placeholder', false));
        $viewResponse->set('optionList', $this->_getOptionList());
        $viewResponse->set('labelPrefix', $renderParams->has('labelPrefix') ? $renderParams->getString('labelPrefix') : null);

        $viewResponse->set('translate', $renderParams->getBoolean('translate', false) || $renderParams->has('translatePrefix'));
        $viewResponse->set('translatePrefix', $renderParams->getString('translatePrefix', ''));
    }
}
{'fraction_non_alphanumeric': 0.1540020263424519, 'fraction_numerical': 0.0, 'mean_word_length': 4.526119402985074, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 40, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2958900', 'n_tokens_mistral': 814, 'n_tokens_neox': 799, 'n_words': 145}