function ValueCallbackTestHelper::upperCaseValue

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/KernelTests/Core/Form/ValueCallbackTestHelper.php \Drupal\KernelTests\Core\Form\ValueCallbackTestHelper::upperCaseValue()

Converts the submitted value to upper case.

Parameters

array $element: The form element.

mixed $input: The submitted input, or FALSE if there is none.

\Drupal\Core\Form\FormStateInterface $form_state: The current form state.

Return value

string|null The input converted to upper case, or NULL.

File

core/tests/Drupal/KernelTests/Core/Form/ValueCallbackTestHelper.php, line 29

Class

ValueCallbackTestHelper
A non-static #value_callback target, resolved via the class resolver.

Namespace

Drupal\KernelTests\Core\Form

Code

public function upperCaseValue(array &$element, mixed $input, FormStateInterface $form_state) : ?string {
  return is_string($input) ? strtoupper($input) : NULL;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.