<commit_before><?php

namespace Nietonfir\Google\ReCaptchaBundle\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class ReCaptchaResponseValidator extends ConstraintValidator
{
    private $revisor;

    public function __construct($revisor)
    {
        $this->revisor = $revisor;
    }

    public function validate($value, Constraint $constraint)
    {
        $response = $this->revisor->verify($value);
        if (!$response->isValid()) {
            // If you're using the new 2.5 validation API (you probably are!)
            $this->context->buildViolation($constraint->message)->addViolation();

            // If you're using the old 2.4 validation API
            // $this->context->addViolation(
            //     $constraint->message,
            //     array('%string%' => $value)
            // );
        }
    }
}
<commit_msg>Drop the 2.4 validation API comment<commit_after><?php

namespace Nietonfir\Google\ReCaptchaBundle\Validator\Constraints;

use Symfony\Component\Validator\Constraint;
use Symfony\Component\Validator\ConstraintValidator;

class ReCaptchaResponseValidator extends ConstraintValidator
{
    private $revisor;

    public function __construct($revisor)
    {
        $this->revisor = $revisor;
    }

    public function validate($value, Constraint $constraint)
    {
        $response = $this->revisor->verify($value);
        if (!$response->isValid()) {
            $this->context->buildViolation($constraint->message)->addViolation();
        }
    }
}

{'fraction_non_alphanumeric': 0.1227735368956743, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 2.9129353233830844, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '821483', 'n_tokens_mistral': 430, 'n_tokens_neox': 430, 'n_words': 84}