RecaptchaRule
final class RecaptchaRule implements ValidationRuleInterface (View source)
Verifies one reCAPTCHA token and includes only the trust-resolved client address.
Traits
Methods
fetchJson(string $url)
array|null
postJson(string $url, array $payload)
array|null
postForm(string $url, array $payload)
array|null
ClientInterface
RequestFactoryInterface
StreamFactoryInterface
__construct(ClientInterface $client, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory, RecaptchaEndpointProviderInterface $endpointProvider, ResolvedRequestContext|null $requestContext = null)
Binds remote verification to HTTP transport services and an optional active request context.
validate(mixed $value, string|null $param, array $data)
Returns true only when the configured verification endpoint accepts the supplied token.
bool
Details
fetchJson
protected array|null
fetchJson(string $url)
No description
postJson
protected array|null
postJson(string $url, array $payload)
No description
postForm
protected array|null
postForm(string $url, array $payload)
No description
jsonFetchClient
protected ClientInterface
jsonFetchClient()
No description
jsonFetchRequestFactory
protected RequestFactoryInterface
jsonFetchRequestFactory()
No description
jsonFetchStreamFactory
protected StreamFactoryInterface
jsonFetchStreamFactory()
No description
__construct
__construct(ClientInterface $client, RequestFactoryInterface $requestFactory, StreamFactoryInterface $streamFactory, RecaptchaEndpointProviderInterface $endpointProvider, ResolvedRequestContext|null $requestContext = null)
Binds remote verification to HTTP transport services and an optional active request context.
validate
bool
validate(mixed $value, string|null $param, array $data)
Returns true only when the configured verification endpoint accepts the supplied token.