You are here

protected static function WebformCodeMirror::getErrors in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Element/WebformCodeMirror.php \Drupal\webform\Element\WebformCodeMirror::getErrors()

Get validation errors.

1 call to WebformCodeMirror::getErrors()
WebformCodeMirror::validateWebformCodeMirror in src/Element/WebformCodeMirror.php
Webform element validation handler for #type 'webform_codemirror'.

File

src/Element/WebformCodeMirror.php, line 174

Class

WebformCodeMirror
Provides a webform element for using CodeMirror.

Namespace

Drupal\webform\Element

Code

protected static function getErrors(&$element, FormStateInterface $form_state, &$complete_form) {
  if (!empty($element['#skip_validation'])) {
    return NULL;
  }
  switch ($element['#mode']) {
    case 'html':
      return static::validateHtml($element, $form_state, $complete_form);
    case 'yaml':
      return static::validateYaml($element, $form_state, $complete_form);
    case 'twig':
      return static::validateTwig($element, $form_state, $complete_form);
    default:
      return NULL;
  }
}