You are here

public function BlockerSettingsForm::stripWhitespaces in Cookie Content Blocker 8

Makes sure whitespaces are stripped off element values.

Parameters

array $element: The element being validated.

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

File

src/Form/BlockerSettingsForm.php, line 126

Class

BlockerSettingsForm
Form builder to manage settings related to the Cookie content blocker.

Namespace

Drupal\cookie_content_blocker\Form

Code

public function stripWhitespaces(array $element, FormStateInterface $form_state) : void {
  $form_state
    ->setValueForElement($element, trim($element['#value']));
}