You are here

public function HotjarSettings::getSettings in Hotjar 8

Same name and namespace in other branches
  1. 8.2 src/HotjarSettings.php \Drupal\hotjar\HotjarSettings::getSettings()

Get all settings.

Return value

array Get settings.

Overrides HotjarSettingsInterface::getSettings

2 calls to HotjarSettings::getSettings()
HotjarSettings::getSetting in src/HotjarSettings.php
Get setting.
HotjarSettings::__construct in src/HotjarSettings.php
HotjarSettings constructor.

File

src/HotjarSettings.php, line 57

Class

HotjarSettings
Class HotjarSettings.

Namespace

Drupal\hotjar

Code

public function getSettings() {
  if (!$this->settings) {
    $settings = (array) $this->config
      ->getOriginal();
    $settings += [
      'account' => NULL,
      'snippet_version' => 6,
      'visibility_pages' => 0,
      'pages' => static::HOTJAR_PAGES,
      'visibility_roles' => 0,
      'roles' => [],
    ];
    if (empty($settings['snippet_version'])) {
      $settings['snippet_version'] = 6;
    }
    $this->settings = $settings;
  }
  return $this->settings;
}