You are here

protected function YamlFormEntityElementsValidator::validateArray in YAML Form 8

Validate elements are an array of elements.

Return value

\Drupal\Core\StringTranslation\TranslatableMarkup|null If not valid an error message.

1 call to YamlFormEntityElementsValidator::validateArray()
YamlFormEntityElementsValidator::validate in src/YamlFormEntityElementsValidator.php
Validate form elements.

File

src/YamlFormEntityElementsValidator.php, line 147

Class

YamlFormEntityElementsValidator
Defines a class to validate form elements.

Namespace

Drupal\yamlform

Code

protected function validateArray() {
  if (!is_array($this->elements)) {
    return $this
      ->t('Elements are not valid. YAML must contain an associative array of elements.');
  }
  return NULL;
}