You are here

public static function FormTestFormStateValuesCleanForm::cleanValue in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php \Drupal\form_test\Form\FormTestFormStateValuesCleanForm::cleanValue()
  2. 10 core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php \Drupal\form_test\Form\FormTestFormStateValuesCleanForm::cleanValue()

Helper function to clean a value on an element.

File

core/modules/system/tests/modules/form_test/src/Form/FormTestFormStateValuesCleanForm.php, line 52

Class

FormTestFormStateValuesCleanForm
Form builder for \Drupal\Core\Form\FormState::cleanValues() test.

Namespace

Drupal\form_test\Form

Code

public static function cleanValue(&$element, FormStateInterface $form_state, &$complete_form) {
  $form_state
    ->addCleanValueKey('wine');
}