You are here

public function HCaptcha::__construct in hCaptcha 8

File

src/HCaptcha/HCaptcha.php, line 26

Class

HCaptcha

Namespace

Drupal\hcaptcha\HCaptcha

Code

public function __construct($site_key, $secret_key, $attributes = array(), RequestMethod $requestMethod = null) {
  $this->siteKey = $site_key;
  $this->secretKey = $secret_key;
  $this->requestMethod = $requestMethod;
  if (!empty($attributes) && is_array($attributes)) {
    foreach ($attributes as $name => $attribute) {
      if (isset($this->attributes[$name])) {
        $this->attributes[$name] = $attribute;
      }
    }
  }
}