You are here

public function ZoneMock::getZoneSettings in CloudFlare 8

Gets the zone's settings from CloudFlare's API.

Return value

\CloudFlarePhpSdk\ApiTypes\Zone\ZoneSettings|null Zone settings retrieved from the CloudFlareAPI. NULL if unable to retrieve.

Overrides CloudFlareZoneInterface::getZoneSettings

File

tests/modules/cloudflare_form_tester/src/Mocks/ZoneMock.php, line 108

Class

ZoneMock
Zone methods for CloudFlare.

Namespace

Drupal\cloudflare_form_tester\Mocks

Code

public function getZoneSettings() {
  $this->cloudFlareComposerDependenciesCheck
    ->assert();
  if (!$this->validCredentials) {
    return NULL;
  }
  try {
    $settings = $this->zoneApi
      ->getZoneSettings($this->zone);
    $this->state
      ->incrementApiRateCount();
    return $settings;
  } catch (CloudFlareException $e) {
    $this->logger
      ->error($e
      ->getMessage());
    throw $e;
  }
}