ConfigBase::validateKeys

protected ConfigBase::validateKeys(array $data)

Validates all keys in a passed in config array structure.

Parameters

array $data: Configuration array structure.

Return value

null

Throws

\Drupal\Core\Config\ConfigValueException If any key in $data in any depth contains a dot.

File

core/lib/Drupal/Core/Config/ConfigBase.php, line 208

Class

ConfigBase
Provides a base class for configuration objects with get/set support.

Namespace

Drupal\Core\Config

Code

protected function validateKeys(array $data) {
  foreach ($data as $key => $value) {
    if (strpos($key, '.') !== FALSE) {
      throw new ConfigValueException("$key key contains a dot which is not supported.");
    }
    if (is_array($value)) {
      $this->validateKeys($value);
    }
  }
}
doc_Drupal
2016-10-29 08:52:12
Comments
Leave a Comment

Please login to continue.