public function __construct(private readonly ValidatorInterface
$validator) { } /**
* Default method for determining constraints when using the Symfony validator.
*/
public static function loadValidatorMetadata(ClassMetadata
$metadata): void
{ $metadata->
addPropertyConstraint('honeypotValue',
new Blank());
} /**
* {@inheritdoc}
*/
public function isValid(Request
$request, array
$captchaConfig): bool
{ $this->honeypotValue =
$request->
get(self::CAPTCHA_REQUEST_PARAMETER, ''
);
return \
count($this->validator->
validate($this)) < 1;
}