Skip to content
Corex

CaptchaResolver

Corex\Captcha\CaptchaResolver · class · Add-ons layer

Selects the configured captcha driver and supplies its secret from the Config engine (captcha.driver, captcha.secret). Switching provider is configuration, not code. Unknown/absent driver → NullCaptcha (the honeypot still guards). recaptcha resolves to the scored v3 driver ({@see RecaptchaV3Captcha}); turnstile and hcaptcha keep the simpler success-only {@see RemoteCaptcha}. The v3 driver’s stateful collaborator — the replay guard — is injected rather than constructed here, so this resolver stays a thin factory over configuration.

__construct(ConfigInterface $config, ?TokenReplayGuard $replay)

Section titled “__construct(ConfigInterface $config, ?TokenReplayGuard $replay)”

The provider siteverify endpoint for a key-driver, or null for none/honeypot/unknown. Exposed so the “Test verification” action can probe the configured provider.