You are here

public function RequestParameters::toArray in reCAPTCHA 7.2

Same name and namespace in other branches
  1. 8.2 recaptcha-php/src/ReCaptcha/RequestParameters.php \ReCaptcha\RequestParameters::toArray()
  2. 6.2 recaptcha-php/src/ReCaptcha/RequestParameters.php \ReCaptcha\RequestParameters::toArray()

Array representation.

Return value

array Array formatted parameters.

1 call to RequestParameters::toArray()
RequestParameters::toQueryString in recaptcha-php/src/ReCaptcha/RequestParameters.php
Query string representation for HTTP request.

File

recaptcha-php/src/ReCaptcha/RequestParameters.php, line 79

Class

RequestParameters
Stores and formats the parameters for the request to the reCAPTCHA service.

Namespace

ReCaptcha

Code

public function toArray() {
  $params = array(
    'secret' => $this->secret,
    'response' => $this->response,
  );
  if (!is_null($this->remoteIp)) {
    $params['remoteip'] = $this->remoteIp;
  }
  if (!is_null($this->version)) {
    $params['version'] = $this->version;
  }
  return $params;
}