You are here

public function ConfigurationSettings::validate in Configuration Management 7.3

1 call to ConfigurationSettings::validate()
ConfigurationSettings::load in src/Helpers/ConfigurationSettings.php
1 method overrides ConfigurationSettings::validate()
ConfigurationSettingsList::validate in src/Helpers/ConfigurationSettingsList.php

File

src/Helpers/ConfigurationSettings.php, line 89

Class

ConfigurationSettings

Namespace

Configuration\Helpers

Code

public function validate() {
  $check = array(
    'export' => array(
      'path',
      'format',
      'fast_export',
      'batch',
      'exclude',
      'groups',
    ),
    'import' => array(
      'path',
      'format',
      'batch',
      'exclude',
      'import_only_if_hash_changed',
      'delete_configs_not_exported',
    ),
  );
  foreach ($check as $group => $keys) {
    foreach ($keys as $key) {
      if (!isset($this->settings->{$group}->{$key})) {
        throw new \Exception("There is no value defined for settings.{$group}.{$key}");
      }
    }
  }
}