<commit_before><?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ValidatorDRevMarcRevendication
 *
 * @author mathurin
 */
class ValidatorDRevMarcRevendication extends sfValidatorBase {

    public function configure($options = array(), $messages = array()) {
        $this->addMessage('invalid_volume_marc', 'La volume d\'alcool pur semble être exprimé en hl');
    }

    protected function doClean($values) {

        $errorSchema = new sfValidatorErrorSchema($this);
        
        if ($values['volume_obtenu'] > $values['qte_marc'] * 20 / 10000) {
            $errorSchema->addError(new sfValidatorError($this, 'invalid_volume_marc'), 'volume_obtenu');
        }
        if (count($errorSchema)) {
            throw new sfValidatorErrorSchema($this, $errorSchema);
        }

        return $values;
    }

}<commit_msg>changement de phrase pour le message d'erreur de saisie des litres dans le form de DREVMARC<commit_after><?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ValidatorDRevMarcRevendication
 *
 * @author mathurin
 */
class ValidatorDRevMarcRevendication extends sfValidatorBase {

    public function configure($options = array(), $messages = array()) {
        $this->addMessage('invalid_volume_marc', 'Le volume d\'alcool pur semble être exprimé en litre');
    }

    protected function doClean($values) {

        $errorSchema = new sfValidatorErrorSchema($this);
        
        if ($values['volume_obtenu'] > $values['qte_marc'] * 20 / 10000) {
            $errorSchema->addError(new sfValidatorError($this, 'invalid_volume_marc'), 'volume_obtenu');
        }
        if (count($errorSchema)) {
            throw new sfValidatorErrorSchema($this, $errorSchema);
        }

        return $values;
    }

}
{'fraction_non_alphanumeric': 0.1089588377723971, 'fraction_numerical': 0.006779661016949152, 'mean_word_length': 3.3221757322175733, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6207316', 'n_tokens_mistral': 604, 'n_tokens_neox': 571, 'n_words': 165}